From 89f8dc712001872783c8b3be7208bc1d726a12dd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 29 Jun 2021 15:35:59 +0200 Subject: global-functions: $LogPrintExit2: allow origin-specific debug Add something like this in global-config-overlay: :global PrintDebugOverride { "dhcp-to-dns"=true; } --- global-functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'global-functions') diff --git a/global-functions b/global-functions index 654642e..63c0e21 100644 --- a/global-functions +++ b/global-functions @@ -489,6 +489,11 @@ :local Exit [ :tostr $4 ]; :global PrintDebug; + :global PrintDebugOverride; + + :global EitherOr; + + :local Debug [ $EitherOr ($PrintDebugOverride->$Name) $PrintDebug ]; :local PrintSeverity do={ :global TerminalColorOutput; @@ -511,7 +516,7 @@ :set Severity "warning"; } - :if ($Severity != "debug" || $PrintDebug = true) do={ + :if ($Severity != "debug" || $Debug = true) do={ :if ($Exit = "true") do={ :error ([ $PrintSeverity $Severity ] . ": " . $Message); } else={ -- cgit v1.2.3-70-g09d2