aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Bootstrap/RegistrationContext.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-04-16 14:26:43 +0200
committerJoas Schilling <coding@schilljs.com>2021-04-27 14:34:32 +0200
commit56ae87c281d2f54b23f98acf0e138d8e72196a06 (patch)
treed875702c4eb0901bcf6d3e23570a05ba5c397954 /lib/private/AppFramework/Bootstrap/RegistrationContext.php
parentbf1c875425e7fdf5ffd3c233ddf1f567428b4168 (diff)
downloadnextcloud-server-56ae87c281d2f54b23f98acf0e138d8e72196a06.tar.gz
nextcloud-server-56ae87c281d2f54b23f98acf0e138d8e72196a06.zip
Less ILogger
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/AppFramework/Bootstrap/RegistrationContext.php')
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php46
1 files changed, 19 insertions, 27 deletions
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index d056c088a9f..0859e606b7e 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -43,10 +43,10 @@ use OCP\Dashboard\IWidget;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Files\Template\ICustomTemplateProvider;
use OCP\Http\WellKnown\IHandler;
-use OCP\ILogger;
use OCP\Notification\INotifier;
use OCP\Search\IProvider;
use OCP\Support\CrashReport\IReporter;
+use Psr\Log\LoggerInterface;
use Throwable;
use function array_shift;
@@ -97,10 +97,10 @@ class RegistrationContext {
/** @var ServiceRegistration<\OCP\Authentication\TwoFactorAuth\IProvider>[] */
private $twoFactorProviders = [];
- /** @var ILogger */
+ /** @var LoggerInterface */
private $logger;
- public function __construct(ILogger $logger) {
+ public function __construct(LoggerInterface $logger) {
$this->logger = $logger;
}
@@ -313,9 +313,8 @@ class RegistrationContext {
->registerCapability($registration->getService());
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during capability registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -330,9 +329,8 @@ class RegistrationContext {
$registry->registerLazy($registration->getService());
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during crash reporter registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during crash reporter registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -347,9 +345,8 @@ class RegistrationContext {
$dashboardManager->lazyRegisterWidget($panel->getService());
} catch (Throwable $e) {
$appId = $panel->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during dashboard registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during dashboard registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -365,9 +362,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during event listener registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during event listener registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -391,9 +387,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during service registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during service registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -408,9 +403,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during service alias registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -425,9 +419,8 @@ class RegistrationContext {
);
} catch (Throwable $e) {
$appId = $registration->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during service alias registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during service alias registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}
@@ -444,9 +437,8 @@ class RegistrationContext {
->registerMiddleWare($middleware->getService());
} catch (Throwable $e) {
$appId = $middleware->getAppId();
- $this->logger->logException($e, [
- 'message' => "Error during capability registration of $appId: " . $e->getMessage(),
- 'level' => ILogger::ERROR,
+ $this->logger->error("Error during capability registration of $appId: " . $e->getMessage(), [
+ 'exception' => $e,
]);
}
}