global-functions: introduce $LogAndPut

This commit is contained in:
Christian Hesse 2020-02-26 12:11:50 +01:00
parent 3ebf68a08c
commit 312caf3f90

View file

@ -38,6 +38,7 @@
:global TimeIsSync;
:global WaitTimeSync;
:global LogAndError;
:global LogAndPut;
# url encoding
:set UrlEncode do={
@ -498,3 +499,12 @@
[ :parse (":log " . $Severity . " \$Message") ];
:error ($Severity . ": " . $Message);
}
# log and put (print on terminal) same text
:set LogAndPut do={
:local Severity [ :tostr $1 ];
:local Message [ :tostr $2 ];
[ :parse (":log " . $Severity . " \$Message") ];
:put ($Severity . ": " . $Message);
}