From 9fec4031b30f5ab56af2f8c284672fcd444e8b62 Mon Sep 17 00:00:00 2001 From: Piotr Mrówczyński Date: Thu, 20 Apr 2017 11:31:00 +0200 Subject: Adjust query/event logging code in favour of more complex owncloud/diagnostics (#27643) * Adjust query/event logging code in favour of more complex owncloud/diagnostics * Add descriptions to IQueryLogger and IEventLogger interfaces --- lib/private/Server.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lib/private/Server.php') diff --git a/lib/private/Server.php b/lib/private/Server.php index 7724feb551b..8c6fb8aab64 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -602,22 +602,23 @@ class Server extends ServerContainer implements IServerContainer { ); }); $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { + $eventLogger = new EventLogger(); if ($c->getSystemConfig()->getValue('debug', false)) { - return new EventLogger(); - } else { - return new NullEventLogger(); + // In debug mode, module is being activated by default + $eventLogger->activate(); } + return $eventLogger; }); $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { + $queryLogger = new QueryLogger(); if ($c->getSystemConfig()->getValue('debug', false)) { - return new QueryLogger(); - } else { - return new NullQueryLogger(); + // In debug mode, module is being activated by default + $queryLogger->activate(); } + return $queryLogger; }); $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); -- cgit v1.2.3