aboutsummaryrefslogtreecommitdiffstats
path: root/sms-forward
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2021-02-22 15:14:10 +0100
committerGravatar Christian Hesse <mail@eworm.de>2021-02-24 21:51:54 +0100
commitf46db918453dcb8878b9a0de6e122fb0ea2224d9 (patch)
tree31544a450651d0705ecdea0c3d35e650ef784d67 /sms-forward
parentb0e52aa2d1baa78fc9d025c0671fea8babba0ec2 (diff)
global: give script or function name in log messages
Diffstat (limited to 'sms-forward')
-rw-r--r--sms-forward7
1 files changed, 4 insertions, 3 deletions
diff --git a/sms-forward b/sms-forward
index abfea99..58ed520 100644
--- a/sms-forward
+++ b/sms-forward
@@ -6,13 +6,14 @@
# forward SMS to e-mail
# https://git.eworm.de/cgit/routeros-scripts/about/doc/sms-forward.md
+:local 0 "sms-forward";
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
:global Identity;
:global IfThenElse;
-:global LogPrintExit;
+:global LogPrintExit2;
:global ScriptLock;
:global SendNotification;
:global SymbolForNotification;
@@ -21,7 +22,7 @@
$ScriptLock "sms-forward";
:if ([ / tool sms get receive-enabled ] = false) do={
- $LogPrintExit warning "Receiving of SMS is not enabled." true;
+ $LogPrintExit2 warning $0 ("Receiving of SMS is not enabled.") true;
}
$WaitFullyConnected;
@@ -39,7 +40,7 @@ $WaitFullyConnected;
:if ($Phone = $Settings->"allowed-number" && \
($SmsVal->"message")~("^:cmd " . $Settings->"secret" . " script ")) do={
- $LogPrintExit debug ("Removing SMS, which started a script.") false;
+ $LogPrintExit2 debug $0 ("Removing SMS, which started a script.") false;
/ tool sms inbox remove $Sms;
} else={
:set Messages ($Messages . "\n\nOn " . $SmsVal->"timestamp" . \