mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $LogPrintExit: make colorful output configurable
This commit is contained in:
@@ -35,6 +35,8 @@
|
|||||||
|
|
||||||
# Toggle this to disable symbols in notifications.
|
# Toggle this to disable symbols in notifications.
|
||||||
:global NotificationsWithSymbols true;
|
:global NotificationsWithSymbols true;
|
||||||
|
# Toggle this to disable color output in terminal/cli.
|
||||||
|
:global TerminalColorOutput true;
|
||||||
|
|
||||||
# This defines what backups to generate and what password to use.
|
# This defines what backups to generate and what password to use.
|
||||||
:global BackupSendBinary false;
|
:global BackupSendBinary false;
|
||||||
|
@@ -413,6 +413,12 @@
|
|||||||
:global PrintDebug;
|
:global PrintDebug;
|
||||||
|
|
||||||
:local PrintSeverity do={
|
:local PrintSeverity do={
|
||||||
|
:global TerminalColorOutput;
|
||||||
|
|
||||||
|
:if ($TerminalColorOutput != true) do={
|
||||||
|
:return $1;
|
||||||
|
}
|
||||||
|
|
||||||
:local Color { debug=96; info=97; warning=93; error=91 };
|
:local Color { debug=96; info=97; warning=93; error=91 };
|
||||||
:return ("\1B[" . $Color->$1 . "m" . $1 . "\1B[0m");
|
:return ("\1B[" . $Color->$1 . "m" . $1 . "\1B[0m");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user