Add option to hide notices of level STATUS_NOTICE in main MDConsole
This is managed using a public static variable MDConsole::$verbose
This commit is contained in:
parent
760e69c72a
commit
aad9c42786
|
@ -28,6 +28,9 @@ final class MDConsole {
|
||||||
const CONSOLE_LOG_USED_RESOURCES_ENABLED = 1;
|
const CONSOLE_LOG_USED_RESOURCES_ENABLED = 1;
|
||||||
const CONSOLE_LOG_USED_RESOURCES_DISABLED = 0;
|
const CONSOLE_LOG_USED_RESOURCES_DISABLED = 0;
|
||||||
|
|
||||||
|
/** @var boolean */
|
||||||
|
public static $verbose = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prints a headline.
|
* 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 {
|
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.
|
// Get parts for generating the message to log.
|
||||||
$additionalNote = \strtr($additionalNote, ["ä" => "ae", "ö" => "oe", "ü" => "ue"]);
|
$additionalNote = \strtr($additionalNote, ["ä" => "ae", "ö" => "oe", "ü" => "ue"]);
|
||||||
$date = \date("H:i:s"); // Get current date & time.
|
$date = \date("H:i:s"); // Get current date & time.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user