modifs.mineures sans commentaires

This commit is contained in:
Jephté Clain 2023-12-27 15:49:59 +04:00
parent 4698eac586
commit 888dd6be1a
3 changed files with 12 additions and 8 deletions

View File

@ -2,7 +2,6 @@
## TOOD
* aliases critical(), important(), ... debug()
* [ ] ProxyMessenger, vers un ou plusieurs messengers
* [ ] support sous-système (instance locale ou globale)
* [ ] msg::push() --> nouvelle instance globale

View File

@ -63,5 +63,10 @@ abstract class _messenger {
function note($content, ?int $level=null): void { foreach (static::get_msgs() as $msg) { $msg->note($content, $level); } }
function warn($content, ?int $level=null): void { foreach (static::get_msgs() as $msg) { $msg->warn($content, $level); } }
function error($content, ?int $level=null): void { foreach (static::get_msgs() as $msg) { $msg->error($content, $level); } }
function debug($content): void { self::info($content, self::DEBUG);}
function important($content): void { self::info($content, self::MAJOR);}
function attention($content): void { self::note($content, self::MAJOR);}
function critical_warn($content): void { self::warn($content, self::MAJOR);}
function critical_error($content): void { self::error($content, self::MAJOR);}
function end(bool $all=false): void { foreach (static::get_msgs() as $msg) { $msg->end($all); } }
}

View File

@ -39,8 +39,8 @@ class StdMessenger implements IMessenger {
"section" => [true, "SECTION!", "===", "<color @b>=", "=</color>", "==="],
"title" => [false, "TITLE!", null, "<color @b>T", "</color>", "==="],
"desc" => ["DESC!", "<color @b>></color>", ""],
"error" => ["CRITICAL!", "<color @r>E!", "</color>"],
"warn" => ["WARNING!", "<color @y>W!", "</color>"],
"error" => ["CRIT.ERROR!", "<color @r>E!", "</color>"],
"warn" => ["CRIT.WARN!", "<color @y>W!", "</color>"],
"note" => ["ATTENTION!", "<color @g>N!", "</color>"],
"info" => ["IMPORTANT!", "<color @b>I!", "</color>"],
"step" => ["*", "<color @w>.</color>", ""],
@ -60,11 +60,11 @@ class StdMessenger implements IMessenger {
self::LEVEL_DEBUG => [
"section" => [true, "section", null, "<color @w>>>", "<<</color>", null],
"title" => [false, "title", null, "<color b>t", "</color>", null],
"desc" => [">", "<color b>></color>", ""],
"error" => ["e", "<color r>e</color><color -r>", "</color>"],
"warn" => ["w", "<color y>w</color><color -y>", "</color>"],
"note" => ["i", "<color b>i</color>", ""],
"info" => ["D", "<color @w>D</color><color w>", "</color>"],
"desc" => ["desc", "<color b>></color>", ""],
"error" => ["debugE", "<color r>e</color><color -r>", "</color>"],
"warn" => ["debugW", "<color y>w</color><color -y>", "</color>"],
"note" => ["debugN", "<color b>i</color>", ""],
"info" => ["debugI", "<color @w>D</color><color w>", "</color>"],
"step" => ["*", "<color @w>.</color>", ""],
"print" => [null, null, null],
],