diff options
author | Robin Appelman <robin@icewind.nl> | 2022-05-13 16:13:37 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-05-25 15:22:38 +0300 |
commit | 8fd2a851f972581a55fe1d7e1d8a27a38f7dffbc (patch) | |
tree | 1bfbc982c1838ff43f9a71b901d2638a399923fc | |
parent | 0ad79deb19a680bd77454c7076cc5275cbdeb322 (diff) |
Fix wrong logger getting used
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
-rw-r--r-- | lib/AppInfo/Application.php | 13 | ||||
-rw-r--r-- | lib/AvirWrapper.php | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 4b3da89..1308cb1 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -20,7 +20,8 @@ use OCP\AppFramework\Bootstrap\IRegistrationContext; use OCP\Files\IHomeStorage; use OCP\Files\Storage\IStorage; use OCP\IL10N; -use OCP\ILogger; +use OCP\Util; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; class Application extends App implements IBootstrap { @@ -31,10 +32,10 @@ class Application extends App implements IBootstrap { } public function register(IRegistrationContext $context): void { + Util::connectHook('OC_Filesystem', 'preSetup', $this, 'setupWrapper'); } public function boot(IBootContext $context): void { - \OCP\Util::connectHook('OC_Filesystem', 'preSetup', $this, 'setupWrapper'); } /** @@ -51,10 +52,10 @@ class Application extends App implements IBootstrap { $container = $this->getContainer(); $scannerFactory = $container->query(ScannerFactory::class); - $l10n = $container->query(IL10N::class); - $logger = $container->query(ILogger::class); - $activityManager = $container->query(IManager::class); - $eventDispatcher = $container->query(EventDispatcherInterface::class); + $l10n = $container->get(IL10N::class); + $logger = $container->get(LoggerInterface::class); + $activityManager = $container->get(IManager::class); + $eventDispatcher = $container->get(EventDispatcherInterface::class); return new AvirWrapper([ 'storage' => $storage, 'scannerFactory' => $scannerFactory, diff --git a/lib/AvirWrapper.php b/lib/AvirWrapper.php index c232b01..b11b272 100644 --- a/lib/AvirWrapper.php +++ b/lib/AvirWrapper.php @@ -17,7 +17,7 @@ use OCP\Activity\IManager as ActivityManager; use OCP\App; use OCP\Files\InvalidContentException; use OCP\IL10N; -use OCP\ILogger; +use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use OCA\Files_Trashbin\Trash\ITrashManager; @@ -34,8 +34,8 @@ class AvirWrapper extends Wrapper { /** @var IL10N */ protected $l10n; - - /** @var ILogger */ + + /** @var LoggerInterface */ protected $logger; /** @var ActivityManager */ @@ -161,7 +161,7 @@ class AvirWrapper extends Wrapper { } ); } catch (\Exception $e) { - $this->logger->logException($e); + $this->logger->error($e->getMessage(), ['exception' => $e]); } return $stream; } |