diff --git a/www/admin/class_test.error_msg.php b/www/admin/class_test.error_msg.php index e174003d..61401575 100644 --- a/www/admin/class_test.error_msg.php +++ b/www/admin/class_test.error_msg.php @@ -40,6 +40,8 @@ print "Log ERROR: " . $log->prAr($em->getFlagLogError()) . "
"; print "FN: " . ml::fromName('Affe')->name . "
"; print "NU: " . ml::fromValue(100)->name . "
"; print "NU: " . ml::fromValue(1000)->name . "
"; +print "OK.: " . ml::ok->name . "
"; +print "OK^: " . ml::fromName('OK')->name . "
"; $em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug'); $em->setErrorMsg('123', 'error', 'msg this is bad, auto logged if debug', 'target-id', 'other-style'); diff --git a/www/lib/CoreLibs/Logging/Logger/MessageLevel.php b/www/lib/CoreLibs/Logging/Logger/MessageLevel.php index ed0fd293..3b74bf52 100644 --- a/www/lib/CoreLibs/Logging/Logger/MessageLevel.php +++ b/www/lib/CoreLibs/Logging/Logger/MessageLevel.php @@ -31,14 +31,14 @@ enum MessageLevel: int public static function fromName(string $name): self { return match (strtolower($name)) { - 'ok', 'OK' => self::ok, - 'success', 'SUCCESS' => self::success, - 'info', 'INFO' => self::info, - 'notice', 'NOTICE' => self::notice, - 'warn', 'warning', 'WARN', 'WARNING' => self::warn, - 'error', 'ERROR' => self::error, - 'abort', 'ABORT' => self::abort, - 'crash', 'CRASH' => self::crash, + 'ok' => self::ok, + 'success' => self::success, + 'info' => self::info, + 'notice' => self::notice, + 'warn', 'warning' => self::warn, + 'error' => self::error, + 'abort' => self::abort, + 'crash' => self::crash, default => self::unknown, }; }