diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-06-27 20:10:45 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-06-27 20:10:54 +0200 |
commit | 2eaad589221a9a189cece52390873f9bd27f113b (patch) | |
tree | 11649909023ee58bc9195f85b716a602f7cd1202 /lib/log.php | |
parent | 009e9559f3a12d7275ab242ececaa7f9452165c1 (diff) | |
download | nextcloud-server-2eaad589221a9a189cece52390873f9bd27f113b.tar.gz nextcloud-server-2eaad589221a9a189cece52390873f9bd27f113b.zip |
Make the object drive the logging backend
This is the other way around then it was.
Diffstat (limited to 'lib/log.php')
-rw-r--r-- | lib/log.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/log.php b/lib/log.php index 442872af9c4..2e26ccad2da 100644 --- a/lib/log.php +++ b/lib/log.php @@ -19,10 +19,6 @@ namespace OC; */ class Log { - const NOTICE=5; - const CRITICAL=6; - const ALERT=7; - /** * System is unusable. * @@ -114,6 +110,11 @@ class Log { $this->log(\OC_Log::DEBUG, $message, $context); } + public function __construct() { + $this->log_class = 'OC_Log_'.ucfirst(\OC_Config::getValue('log_type', 'owncloud')); + call_user_func(array($this->log_class, 'init')); + } + /** * Logs with an arbitrary level. * @@ -127,6 +128,7 @@ class Log { } else { $app = 'no app in context'; } - \OC_Log::write($app, $message, $level); + $log_class=$this->log_class; + $log_class::write($app, $message, $level); } } |