summaryrefslogtreecommitdiffstats
path: root/lib/log.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-12 15:45:05 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-12 15:45:05 +0200
commitd589869a345bea06874bb38bd54762c972d93249 (patch)
treeb800d177e3d890e13c00ad83d35dd8f5a66f50b1 /lib/log.php
parent6f3e039e78074d1ae684fedbb3aa0bf887568385 (diff)
downloadnextcloud-server-d589869a345bea06874bb38bd54762c972d93249.tar.gz
nextcloud-server-d589869a345bea06874bb38bd54762c972d93249.zip
disable log when running tests
Diffstat (limited to 'lib/log.php')
-rw-r--r--lib/log.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/log.php b/lib/log.php
index 8bb2839be66..6de99b4ea6b 100644
--- a/lib/log.php
+++ b/lib/log.php
@@ -20,6 +20,7 @@ class OC_Log {
const ERROR=3;
const FATAL=4;
+ static public $enabled = true;
static protected $class = null;
/**
@@ -29,11 +30,13 @@ class OC_Log {
* @param int level
*/
public static function write($app, $message, $level) {
- if (!self::$class) {
- self::$class = 'OC_Log_'.ucfirst(OC_Config::getValue('log_type', 'owncloud'));
- call_user_func(array(self::$class, 'init'));
+ if (self::$enabled) {
+ if (!self::$class) {
+ self::$class = 'OC_Log_'.ucfirst(OC_Config::getValue('log_type', 'owncloud'));
+ call_user_func(array(self::$class, 'init'));
+ }
+ $log_class=self::$class;
+ $log_class::write($app, $message, $level);
}
- $log_class=self::$class;
- $log_class::write($app, $message, $level);
}
}