diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-30 10:55:41 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-04-26 16:52:52 +0200 |
commit | 069477e608566c6ea9edbe259b46c591a82bd8af (patch) | |
tree | df1d338e1d61d1c1b2151e1843dfaff7585818d1 /lib/private/Support | |
parent | 0654b245280a904068079b71c5339561537fdf78 (diff) | |
download | nextcloud-server-069477e608566c6ea9edbe259b46c591a82bd8af.tar.gz nextcloud-server-069477e608566c6ea9edbe259b46c591a82bd8af.zip |
Migrate more classes of lib/private to LoggerInterface
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Support')
-rw-r--r-- | lib/private/Support/CrashReport/Registry.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/private/Support/CrashReport/Registry.php b/lib/private/Support/CrashReport/Registry.php index 96796d6370f..472f39c2884 100644 --- a/lib/private/Support/CrashReport/Registry.php +++ b/lib/private/Support/CrashReport/Registry.php @@ -28,12 +28,12 @@ namespace OC\Support\CrashReport; use Exception; use OCP\AppFramework\QueryException; -use OCP\ILogger; use OCP\IServerContainer; use OCP\Support\CrashReport\ICollectBreadcrumbs; use OCP\Support\CrashReport\IMessageReporter; use OCP\Support\CrashReport\IRegistry; use OCP\Support\CrashReport\IReporter; +use Psr\Log\LoggerInterface; use Throwable; use function array_shift; @@ -48,9 +48,6 @@ class Registry implements IRegistry { /** @var IServerContainer */ private $serverContainer; - /** @var ILogger */ - private $logger; - public function __construct(IServerContainer $serverContainer) { $this->serverContainer = $serverContainer; } @@ -129,9 +126,8 @@ class Registry implements IRegistry { * There is a circular dependency between the logger and the registry, so * we can not inject it. Thus the static call. */ - \OC::$server->getLogger()->logException($e, [ - 'message' => 'Could not load lazy crash reporter: ' . $e->getMessage(), - 'level' => ILogger::FATAL, + \OC::$server->get(LoggerInterface::class)->critical('Could not load lazy crash reporter: ' . $e->getMessage(), [ + 'exception' => $e, ]); } /** @@ -145,9 +141,8 @@ class Registry implements IRegistry { * There is a circular dependency between the logger and the registry, so * we can not inject it. Thus the static call. */ - \OC::$server->getLogger()->logException($e, [ - 'message' => 'Could not register lazy crash reporter: ' . $e->getMessage(), - 'level' => ILogger::FATAL, + \OC::$server->get(LoggerInterface::class)->critical('Could not register lazy crash reporter: ' . $e->getMessage(), [ + 'exception' => $e, ]); } } |