diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-07-15 22:19:11 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2019-07-16 22:38:14 +0200 |
commit | 99f2c82222b0c67b3eddc8dff71aed1acacf1f23 (patch) | |
tree | e69aaa0e4ddde219ae688142d5cfa6a6f4f6db8a /lib/private/App/AppManager.php | |
parent | 5898e87e0f69ed4a3be73cd044c19d7c4872b639 (diff) | |
download | nextcloud-server-99f2c82222b0c67b3eddc8dff71aed1acacf1f23.tar.gz nextcloud-server-99f2c82222b0c67b3eddc8dff71aed1acacf1f23.zip |
Properly inject the logger
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/App/AppManager.php')
-rw-r--r-- | lib/private/App/AppManager.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 77756999c79..17addc86c9d 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -39,6 +39,7 @@ use OCP\App\ManagerEvent; use OCP\ICacheFactory; use OCP\IGroup; use OCP\IGroupManager; +use OCP\ILogger; use OCP\IUser; use OCP\IUserSession; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -72,6 +73,9 @@ class AppManager implements IAppManager { /** @var EventDispatcherInterface */ private $dispatcher; + /** @var ILogger */ + private $logger; + /** @var string[] $appId => $enabled */ private $installedAppsCache; @@ -98,12 +102,14 @@ class AppManager implements IAppManager { AppConfig $appConfig, IGroupManager $groupManager, ICacheFactory $memCacheFactory, - EventDispatcherInterface $dispatcher) { + EventDispatcherInterface $dispatcher, + ILogger $logger) { $this->userSession = $userSession; $this->appConfig = $appConfig; $this->groupManager = $groupManager; $this->memCacheFactory = $memCacheFactory; $this->dispatcher = $dispatcher; + $this->logger = $logger; } /** @@ -220,7 +226,7 @@ class AppManager implements IAppManager { if (!is_array($groupIds)) { $jsonError = json_last_error(); - \OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); + $this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); return false; } @@ -253,7 +259,7 @@ class AppManager implements IAppManager { if (!is_array($groupIds)) { $jsonError = json_last_error(); - \OC::$server->getLogger()->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); + $this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']); return false; } |