From 43ecec854fccb27bdf4424d684f72519f75e0484 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 27 Mar 2024 07:43:32 +0100 Subject: global-functions: $LogPrintOnce: detect and warn on possible crash --- global-functions.rsc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/global-functions.rsc b/global-functions.rsc index 59ba039..b3d8719 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -737,6 +737,11 @@ :return false; } + :if ([ :len [ /log/find where message=($Name . ": " . $Message) ] ] > 0) do={ + $LogPrint warning $0 \ + ("The message is already in log, scripting subsystem may have crashed before!"); + } + :set ($LogPrintOnceMessages->$Message) 1; $LogPrint $Severity $Name $Message; :return true; -- cgit v1.2.3-70-g09d2