diff --git a/src/danog/MadelineProto/Logger.php b/src/danog/MadelineProto/Logger.php index fe6faa354..03352d46f 100644 --- a/src/danog/MadelineProto/Logger.php +++ b/src/danog/MadelineProto/Logger.php @@ -123,12 +123,12 @@ class Logger public static function log($param, $level = self::NOTICE) { + if ($level > self::$level || self::$mode === 0) { + return false; + } if (self::$mode === 4) { return call_user_func_array(self::$optional, [$param, $level]); } - if ($level > self::$level) { - return false; - } $prefix = self::$prefix; if (\danog\MadelineProto\Logger::$has_thread && is_object(\Thread::getCurrentThread())) { $prefix .= ' (t)';