diff options
author | Christian Hesse <mail@eworm.de> | 2021-06-29 15:35:59 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-06-30 11:12:12 +0200 |
commit | 89f8dc712001872783c8b3be7208bc1d726a12dd (patch) | |
tree | 29374f9690e1c5f2e3b0de6ff2e9b8acdfda00c9 | |
parent | 679917390bbb71b33d82be55ff55e21ed041dadd (diff) |
global-functions: $LogPrintExit2: allow origin-specific debug
Add something like this in global-config-overlay:
:global PrintDebugOverride {
"dhcp-to-dns"=true;
}
-rw-r--r-- | global-functions | 7 |
1 files changed, 6 insertions, 1 deletions
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={ |