summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-09-29 14:35:32 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-09-29 16:23:37 +0200
commit3f79484c45cb32118bb79e6e82336157b164cb2d (patch)
treef9331304318ea07dcc99a1db94379184ceeca5b6 /lib
parent5f81a5e6411a82c7a7c8b2a93a73c7ee5a975ff5 (diff)
downloadnextcloud-server-3f79484c45cb32118bb79e6e82336157b164cb2d.tar.gz
nextcloud-server-3f79484c45cb32118bb79e6e82336157b164cb2d.zip
[upgrade] switch to debug logging on upgrade
* resets afterwards * adds output about the previous log level
Diffstat (limited to 'lib')
-rw-r--r--lib/private/updater.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/private/updater.php b/lib/private/updater.php
index 4d2f3ab7d75..2980e940aaa 100644
--- a/lib/private/updater.php
+++ b/lib/private/updater.php
@@ -8,6 +8,7 @@
namespace OC;
+use OC\Core\Command\Log\Manage;
use OC\Hooks\BasicEmitter;
use OC_App;
use OC_Util;
@@ -42,6 +43,14 @@ class Updater extends BasicEmitter {
/** @var bool */
private $skip3rdPartyAppsDisable;
+ private $logLevelNames = [
+ 0 => 'Debug',
+ 1 => 'Info',
+ 2 => 'Warning',
+ 3 => 'Error',
+ 4 => 'Fatal',
+ ];
+
/**
* @param HTTPHelper $httpHelper
* @param IConfig $config
@@ -150,6 +159,10 @@ class Updater extends BasicEmitter {
* @return bool true if the operation succeeded, false otherwise
*/
public function upgrade() {
+ $logLevel = $this->config->getSystemValue('loglevel', \OCP\Util::WARN);
+ $this->emit('\OC\Updater', 'setDebugLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]);
+ $this->config->setSystemValue('loglevel', \OCP\Util::DEBUG);
+
$this->config->setSystemValue('maintenance', true);
$installedVersion = $this->config->getSystemValue('version', '0.0.0');
@@ -172,6 +185,9 @@ class Updater extends BasicEmitter {
$this->emit('\OC\Updater', 'maintenanceEnd');
$this->emit('\OC\Updater', 'updateEnd', array($success));
+ $this->emit('\OC\Updater', 'resetLogLevel', [ $logLevel, $this->logLevelNames[$logLevel] ]);
+ $this->config->setSystemValue('loglevel', $logLevel);
+
return $success;
}