Skip to content

Commit

Permalink
Avoid LogLevel, since Nextcloud supports only integer levels.
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnomad committed Oct 14, 2023
1 parent b0ed083 commit 8b5490e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/Controller/OpdsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
use OCP\IL10N;
use OCP\IRequest;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;

class OpdsController extends Controller {
private const DEFAULT_PREFIX_LENGTH = 1;
Expand Down Expand Up @@ -73,7 +72,7 @@ private function methodWrapper(callable $func): Response {
$lib = $this->calibre->getDatabase($libPath);
return call_user_func($func, $libPath, $lib);
} catch (Exception $e) {
$this->logger->log(LogLevel::ERROR, 'Exception in '.__FUNCTION__, [ 'exception' => $e ]);
$this->logger->error('Exception in '.__FUNCTION__, [ 'exception' => $e ]);
return (new Response())->setStatus(Http::STATUS_INTERNAL_SERVER_ERROR);
}
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use OCP\IRequest;
use OCP\PreConditionNotMetException;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use UnexpectedValueException;

class SettingsController extends Controller {
Expand All @@ -26,7 +25,7 @@ public function settings(string $libraryRoot): array {
try {
$this->settings->setLibrary($libraryRoot);
} catch (PreConditionNotMetException|UnexpectedValueException $e) {
$this->logger->log(LogLevel::ERROR, 'Exception in '.__FUNCTION__, [ 'exception' => $e ]);
$this->logger->error('Exception in '.__FUNCTION__, [ 'exception' => $e ]);
}
return [
'libraryRoot' => $this->settings->getLibrary()
Expand Down

0 comments on commit 8b5490e

Please sign in to comment.