mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-23 10:08:40 +02:00
global-functions: $LogPrintExit: make colorful output configurable
This commit is contained in:
parent
bbf918e329
commit
b780b40baf
2 changed files with 8 additions and 0 deletions
|
@ -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");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue