aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'global-functions.rsc')
-rw-r--r--global-functions.rsc23
1 files changed, 23 insertions, 0 deletions
diff --git a/global-functions.rsc b/global-functions.rsc
index 96b8845..bacda7c 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -45,6 +45,7 @@
:global IsMacLocallyAdministered;
:global IsTimeSync;
:global LogPrintExit2;
+:global LogPrintOnce;
:global MkDir;
:global NotificationFunctions;
:global ParseDate;
@@ -613,6 +614,28 @@
}
}
+# log and print, once until reboot
+:set LogPrintOnce do={
+ :local Severity [ :tostr $1 ];
+ :local Name [ :tostr $2 ];
+ :local Message [ :tostr $3 ];
+
+ :global LogPrintExit2;
+
+ :global LogPrintOnceMessages;
+
+ :if ([ :typeof $LogPrintOnceMessages ] = "nothing") do={
+ :set LogPrintOnceMessages ({});
+ }
+
+ :if ($LogPrintOnceMessages->$Message = 1) do={
+ :return true;
+ }
+
+ :set ($LogPrintOnceMessages->$Message) 1;
+ $LogPrintExit2 $Severity $Name $Message false;
+}
+
# create directory
:set MkDir do={
:local Path [ :tostr $1 ];