aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-03-05 08:06:43 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-03-05 08:11:17 +0100
commit792eba8465291b2ae1f372c41b9c833bf5d7a340 (patch)
tree382a6f2ab0d605a992af1388a3bc6a957d06207b /global-functions
parent478688d5345cd29d6b5b31db91ca6e49b41eaac6 (diff)
global-functions: $LogPrintExit: add debugging option
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions19
1 files changed, 12 insertions, 7 deletions
diff --git a/global-functions b/global-functions
index 8acc351..23283f1 100644
--- a/global-functions
+++ b/global-functions
@@ -274,17 +274,22 @@
:local Message [ :tostr $2 ];
:local Exit [ :tostr $3 ];
- :if ($Severity ~ "^(error|info)\$") do={
- :if ($Severity = "error" ) do={ :log error $Message; }
- :if ($Severity = "info" ) do={ :log info $Message; }
+ :global PrintDebug;
+
+ :if ($Severity ~ "^(debug|error|info)\$") do={
+ :if ($Severity = "debug") do={ :log debug $Message; }
+ :if ($Severity = "error") do={ :log error $Message; }
+ :if ($Severity = "info" ) do={ :log info $Message; }
} else={
:log warning $Message;
}
- :if ($Exit = "true") do={
- :error ($Severity . ": " . $Message);
- } else={
- :put ($Severity . ": " . $Message);
+ :if ($Severity != "debug" || $PrintDebug = true) do={
+ :if ($Exit = "true") do={
+ :error ($Severity . ": " . $Message);
+ } else={
+ :put ($Severity . ": " . $Message);
+ }
}
}