mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: $LogPrintExit: add debugging option
This commit is contained in:
parent
478688d534
commit
792eba8465
1 changed files with 12 additions and 7 deletions
|
@ -274,17 +274,22 @@
|
||||||
:local Message [ :tostr $2 ];
|
:local Message [ :tostr $2 ];
|
||||||
:local Exit [ :tostr $3 ];
|
:local Exit [ :tostr $3 ];
|
||||||
|
|
||||||
:if ($Severity ~ "^(error|info)\$") do={
|
:global PrintDebug;
|
||||||
:if ($Severity = "error" ) do={ :log error $Message; }
|
|
||||||
:if ($Severity = "info" ) do={ :log info $Message; }
|
: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={
|
} else={
|
||||||
:log warning $Message;
|
:log warning $Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
:if ($Exit = "true") do={
|
:if ($Severity != "debug" || $PrintDebug = true) do={
|
||||||
:error ($Severity . ": " . $Message);
|
:if ($Exit = "true") do={
|
||||||
} else={
|
:error ($Severity . ": " . $Message);
|
||||||
:put ($Severity . ": " . $Message);
|
} else={
|
||||||
|
:put ($Severity . ": " . $Message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue