Skip to content

Commit

Permalink
Add missing use for LoggerInterface
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed May 2, 2022
1 parent 5fb9de6 commit 771028d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/dav/lib/HookManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use OCP\IUser;
use OCP\IUserManager;
use OCP\Util;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

class HookManager {
Expand Down
5 changes: 3 additions & 2 deletions remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
use OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin;
use Sabre\DAV\Exception\ServiceUnavailable;
use Sabre\DAV\Server;
use Psr\Log\LoggerInterface;

/**
* Class RemoteException
Expand All @@ -57,7 +58,7 @@ function handleException($e) {
$server = new Server();
if (!($e instanceof RemoteException)) {
// we shall not log on RemoteException
$server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->getLogger()));
$server->addPlugin(new ExceptionLoggerPlugin('webdav', \OC::$server->get(LoggerInterface::class)));
}
$server->on('beforeMethod:*', function () use ($e) {
if ($e instanceof RemoteException) {
Expand All @@ -82,7 +83,7 @@ function handleException($e) {
// we shall not log on RemoteException
OC_Template::printErrorPage($e->getMessage(), '', $e->getCode());
} else {
\OC::$server->getLogger()->logException($e, ['app' => 'remote']);
\OC::$server->get(LoggerInterface::class)->error($e->getMessage(), ['app' => 'remote','exception' => $e]);
OC_Template::printExceptionErrorPage($e, $statusCode);
}
}
Expand Down

0 comments on commit 771028d

Please sign in to comment.