diff options
author | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-02 14:04:58 +0200 |
---|---|---|
committer | Roeland Jago Douma <rullzer@owncloud.com> | 2016-05-03 08:57:26 +0200 |
commit | fc82047e26274463ec8bd7fdfac15d889292e00a (patch) | |
tree | 56dd58beed2dbe71464aa8b830c091fad2fca647 /lib | |
parent | adf7e7295ed94a04bd9fcb056b81e664b45b4f07 (diff) | |
download | nextcloud-server-fc82047e26274463ec8bd7fdfac15d889292e00a.tar.gz nextcloud-server-fc82047e26274463ec8bd7fdfac15d889292e00a.zip |
Move OC_Log_xx to \OC\Log namespace
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Log.php | 2 | ||||
-rw-r--r-- | lib/private/Server.php | 2 | ||||
-rw-r--r-- | lib/private/log/errorlog.php | 4 | ||||
-rw-r--r-- | lib/private/log/owncloud.php | 16 | ||||
-rw-r--r-- | lib/private/log/syslog.php | 4 |
5 files changed, 17 insertions, 11 deletions
diff --git a/lib/private/Log.php b/lib/private/Log.php index d82346bbcf0..9248070c067 100644 --- a/lib/private/Log.php +++ b/lib/private/Log.php @@ -73,7 +73,7 @@ class Log implements ILogger { // FIXME: Add this for backwards compatibility, should be fixed at some point probably if($logger === null) { - $this->logger = 'OC_Log_'.ucfirst($this->config->getValue('log_type', 'owncloud')); + $this->logger = 'OC\\Log\\'.ucfirst($this->config->getValue('log_type', 'owncloud')); call_user_func(array($this->logger, 'init')); } else { $this->logger = $logger; diff --git a/lib/private/Server.php b/lib/private/Server.php index a98ddc36b58..7fe20561af9 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -329,7 +329,7 @@ class Server extends ServerContainer implements IServerContainer { }); $this->registerService('Logger', function (Server $c) { $logClass = $c->query('AllConfig')->getSystemValue('log_type', 'owncloud'); - $logger = 'OC_Log_' . ucfirst($logClass); + $logger = 'OC\\Log\\' . ucfirst($logClass); call_user_func(array($logger, 'init')); return new Log($logger); diff --git a/lib/private/log/errorlog.php b/lib/private/log/errorlog.php index ad3605136d0..37498c36aba 100644 --- a/lib/private/log/errorlog.php +++ b/lib/private/log/errorlog.php @@ -23,7 +23,9 @@ * THE SOFTWARE. */ -class OC_Log_Errorlog { +namespace OC\Log; + +class Errorlog { /** diff --git a/lib/private/log/owncloud.php b/lib/private/log/owncloud.php index 9c106299e4c..13997a0d552 100644 --- a/lib/private/log/owncloud.php +++ b/lib/private/log/owncloud.php @@ -27,13 +27,15 @@ * */ +namespace OC\Log; + /** * logging utilities * * Log is saved at data/owncloud.log (on default) */ -class OC_Log_Owncloud { +class Owncloud { static protected $logFile; /** @@ -41,7 +43,7 @@ class OC_Log_Owncloud { */ public static function init() { $systemConfig = \OC::$server->getSystemConfig(); - $defaultLogFile = $systemConfig->getValue("datadirectory", OC::$SERVERROOT.'/data').'/owncloud.log'; + $defaultLogFile = $systemConfig->getValue("datadirectory", \OC::$SERVERROOT.'/data').'/owncloud.log'; self::$logFile = $systemConfig->getValue("logfile", $defaultLogFile); /** @@ -72,13 +74,13 @@ class OC_Log_Owncloud { $format = $config->getValue('logdateformat', 'c'); $logTimeZone = $config->getValue( "logtimezone", 'UTC' ); try { - $timezone = new DateTimeZone($logTimeZone); - } catch (Exception $e) { - $timezone = new DateTimeZone('UTC'); + $timezone = new \DateTimeZone($logTimeZone); + } catch (\Exception $e) { + $timezone = new \DateTimeZone('UTC'); } - $time = DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", "")); + $time = \DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", "")); if ($time === false) { - $time = new DateTime(null, $timezone); + $time = new \DateTime(null, $timezone); } else { // apply timezone if $time is created from UNIX timestamp $time->setTimezone($timezone); diff --git a/lib/private/log/syslog.php b/lib/private/log/syslog.php index 96cf463d042..115103f26d6 100644 --- a/lib/private/log/syslog.php +++ b/lib/private/log/syslog.php @@ -21,7 +21,9 @@ * */ -class OC_Log_Syslog { +namespace OC\Log; + +class Syslog { static protected $levels = array( \OCP\Util::DEBUG => LOG_DEBUG, \OCP\Util::INFO => LOG_INFO, |