diff --git a/include/text.php b/include/text.php index 4b2a4a9409..5c9202c580 100644 --- a/include/text.php +++ b/include/text.php @@ -703,15 +703,20 @@ function logger($msg, $level = 0) { global $db; global $LOGGER_LEVELS; - $debugging = get_config('system','debugging'); - $logfile = get_config('system','logfile'); - $loglevel = intval(get_config('system','loglevel')); - // turn off logger in install mode if ( $a->module == 'install' || ! ($db && $db->connected) - || ! $debugging + ) { + return; + } + + $debugging = get_config('system','debugging'); + $logfile = get_config('system','logfile'); + $loglevel = intval(get_config('system','loglevel')); + + if ( + ! $debugging || ! $logfile || $level > $loglevel ) {