From 888dd6be1a1594d9b6394a0478cdd6df55a3f1c1 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Wed, 27 Dec 2023 15:49:59 +0400 Subject: [PATCH] modifs.mineures sans commentaires --- src/output/TODO.md | 1 - src/output/_messenger.php | 5 +++++ src/output/std/StdMessenger.php | 14 +++++++------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/output/TODO.md b/src/output/TODO.md index d502b69..270ebad 100644 --- a/src/output/TODO.md +++ b/src/output/TODO.md @@ -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 diff --git a/src/output/_messenger.php b/src/output/_messenger.php index 716d8bb..068b711 100644 --- a/src/output/_messenger.php +++ b/src/output/_messenger.php @@ -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); } } } diff --git a/src/output/std/StdMessenger.php b/src/output/std/StdMessenger.php index 390b29d..2789383 100644 --- a/src/output/std/StdMessenger.php +++ b/src/output/std/StdMessenger.php @@ -39,8 +39,8 @@ class StdMessenger implements IMessenger { "section" => [true, "SECTION!", "===", "=", "=", "==="], "title" => [false, "TITLE!", null, "T", "", "==="], "desc" => ["DESC!", ">", ""], - "error" => ["CRITICAL!", "E!", ""], - "warn" => ["WARNING!", "W!", ""], + "error" => ["CRIT.ERROR!", "E!", ""], + "warn" => ["CRIT.WARN!", "W!", ""], "note" => ["ATTENTION!", "N!", ""], "info" => ["IMPORTANT!", "I!", ""], "step" => ["*", ".", ""], @@ -60,11 +60,11 @@ class StdMessenger implements IMessenger { self::LEVEL_DEBUG => [ "section" => [true, "section", null, ">>", "<<", null], "title" => [false, "title", null, "t", "", null], - "desc" => [">", ">", ""], - "error" => ["e", "e", ""], - "warn" => ["w", "w", ""], - "note" => ["i", "i", ""], - "info" => ["D", "D", ""], + "desc" => ["desc", ">", ""], + "error" => ["debugE", "e", ""], + "warn" => ["debugW", "w", ""], + "note" => ["debugN", "i", ""], + "info" => ["debugI", "D", ""], "step" => ["*", ".", ""], "print" => [null, null, null], ],