aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/DependencyInjection
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-09-04 10:05:25 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-09-04 10:05:25 +0200
commit9319d557a4b1156d82d824cdb1b7d6f07ad3fbde (patch)
tree72131fa52a79aaacefff9514113f9ba575afd7de /lib/private/AppFramework/DependencyInjection
parent373630c78fc88bfb8b1e025432ab705ab98f63c8 (diff)
downloadnextcloud-server-9319d557a4b1156d82d824cdb1b7d6f07ad3fbde.tar.gz
nextcloud-server-9319d557a4b1156d82d824cdb1b7d6f07ad3fbde.zip
Add wrapper Logger in DIContainer
This makes sure that for example app for the context is always set. We can in the future extend this to include more info. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework/DependencyInjection')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 8803ef8c47d..439404f26ce 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -120,6 +120,11 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getL10N($c->query('AppName'));
});
+ // Log wrapper
+ $this->registerService(ILogger::class, function ($c) {
+ return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->query('AppName'));
+ });
+
$this->registerAlias(\OCP\AppFramework\Utility\IControllerMethodReflector::class, \OC\AppFramework\Utility\ControllerMethodReflector::class);
$this->registerAlias('ControllerMethodReflector', \OCP\AppFramework\Utility\IControllerMethodReflector::class);