From aad9c42786298f0883f762fde742078a6ad4067a Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Thu, 21 Jan 2021 08:39:42 +0100 Subject: [PATCH] Add option to hide notices of level STATUS_NOTICE in main MDConsole This is managed using a public static variable MDConsole::$verbose --- src/MDConsole.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MDConsole.php b/src/MDConsole.php index 7395397..eaa4916 100644 --- a/src/MDConsole.php +++ b/src/MDConsole.php @@ -28,6 +28,9 @@ final class MDConsole { const CONSOLE_LOG_USED_RESOURCES_ENABLED = 1; const CONSOLE_LOG_USED_RESOURCES_DISABLED = 0; + /** @var boolean */ + public static $verbose = true; + /** * Prints a headline. * @@ -86,6 +89,8 @@ final class MDConsole { */ final public static function write(string $context, int $level = self::STATUS_NOTICE, int $editedNo = 0, string $additionalNote = "", string $link = ""):void { + if (self::$verbose === false and $level === self::STATUS_NOTICE) return; + // Get parts for generating the message to log. $additionalNote = \strtr($additionalNote, ["ä" => "ae", "ö" => "oe", "ü" => "ue"]); $date = \date("H:i:s"); // Get current date & time.