From 2eaad589221a9a189cece52390873f9bd27f113b Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Thu, 27 Jun 2013 20:10:45 +0200 Subject: Make the object drive the logging backend This is the other way around then it was. --- lib/log.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/log.php') 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); } } -- cgit v1.2.3