From a2b2d3a2feedb072dc708e6aa9bb8dcedd1a7785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerry=20Wei=C3=9Fbach?= Date: Wed, 21 Jun 2023 09:18:04 +0200 Subject: [PATCH] Only log if levbel is set. --- inc/debug.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/debug.php b/inc/debug.php index 06c547d..cfe2f93 100644 --- a/inc/debug.php +++ b/inc/debug.php @@ -79,6 +79,8 @@ public function message($info,$var=null,$level=4){ $ajaxCanLog = $this->isAJAX && $level == 4; $fh = false; + + if( $this->debugLevel > $level && !$ajaxCanLog ) return; // only log certain Debug Levels switch($level) { case 4: $this->logger->error( $info, $var ); break; @@ -88,8 +90,6 @@ public function message($info,$var=null,$level=4){ default: $TYPE = " NONE"; break; } - if( $this->debugLevel > $level && !$ajaxCanLog ) return; // only log certain Debug Levels - if ( empty($this->debugFile) ) { $this->runtimeException("DebugFile not properly configured. Make sure, it is set, readable and writable. We suggest to use a file in the DokuWiki's media directory.", true); $this->debugLevel = 5; // shutdown debug