From 6faff353d3b7b91e1094eb99c59f6939046c853a Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Fri, 3 Mar 2023 10:37:56 +0100 Subject: [PATCH] Log: try to properly handle log message before initialization --- src/Log.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Log.php b/src/Log.php index 1b18ea3..d0eba40 100644 --- a/src/Log.php +++ b/src/Log.php @@ -161,6 +161,12 @@ class Log { ); $level = 'WARNING'; } + if (!self :: $level) + self :: $level = ( + App::initialized()? + App::get('log.level', 'WARNING', 'string'): + 'WARNING' + ); if (self :: $levels[$level] < self :: $levels[self :: $level]) return true; if(self :: $filepath && is_null(self :: $file_fd)) { self :: $file_fd = fopen(self :: $filepath, 'a');