From b780b40baf904a0448d1a8e60cc6e3626183120c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 22 Jan 2021 09:20:49 +0100 Subject: global-functions: $LogPrintExit: make colorful output configurable --- global-config | 2 ++ global-functions | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/global-config b/global-config index d33b7b7..4e1bca5 100644 --- a/global-config +++ b/global-config @@ -35,6 +35,8 @@ # Toggle this to disable symbols in notifications. :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. :global BackupSendBinary false; diff --git a/global-functions b/global-functions index d66541d..3518e36 100644 --- a/global-functions +++ b/global-functions @@ -413,6 +413,12 @@ :global PrintDebug; :local PrintSeverity do={ + :global TerminalColorOutput; + + :if ($TerminalColorOutput != true) do={ + :return $1; + } + :local Color { debug=96; info=97; warning=93; error=91 }; :return ("\1B[" . $Color->$1 . "m" . $1 . "\1B[0m"); } -- cgit v1.2.3-54-g00ecf