summaryrefslogtreecommitdiffstats
path: root/lib/private/Server.php
diff options
context:
space:
mode:
authorPiotr Mrówczyński <mrow4a@yahoo.com>2017-04-20 11:31:00 +0200
committerJoas Schilling <coding@schilljs.com>2017-04-26 13:19:43 +0200
commit9fec4031b30f5ab56af2f8c284672fcd444e8b62 (patch)
treebbecebfaa1fa8fd376b02dec9078573478fd6864 /lib/private/Server.php
parent5b5c3a1773dab4960d41aafc4150859a308311b7 (diff)
downloadnextcloud-server-9fec4031b30f5ab56af2f8c284672fcd444e8b62.tar.gz
nextcloud-server-9fec4031b30f5ab56af2f8c284672fcd444e8b62.zip
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
Diffstat (limited to 'lib/private/Server.php')
-rw-r--r--lib/private/Server.php15
1 files changed, 8 insertions, 7 deletions
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);