diff options
author | Christian Hesse <mail@eworm.de> | 2023-10-10 23:43:59 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-10-17 14:05:03 +0200 |
commit | 24823441c33b5558ff9b87f6a8586620e7dad079 (patch) | |
tree | 0f18537a3ef66b24995a179a59a8e8de12453c63 /log-forward.rsc | |
parent | ef3b8f8ddd9a222df252a6c9e986d2330072ec7f (diff) |
log-forward: use colorful bullets to indicate severitychange-108
Diffstat (limited to 'log-forward.rsc')
-rw-r--r-- | log-forward.rsc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/log-forward.rsc b/log-forward.rsc index 96cb257..e847256 100644 --- a/log-forward.rsc +++ b/log-forward.rsc @@ -17,7 +17,6 @@ :global LogForwardIncludeMessage; :global LogForwardLast; :global LogForwardRateLimit; -:global NotificationsWithSymbols; :global EitherOr; :global HexToNum; @@ -53,14 +52,19 @@ $ScriptLock $0; !(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \ topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={ :set MessageVal [ /log/get $Message ]; + :local Bullet "information"; :if ($Last < [ $HexToNum ($MessageVal->".id") ]) do={ :local DupCount ($MessageDups->($MessageVal->"message")); - :if ($MessageVal->"topics" ~ "(emergency|alert|critical|error|warning)") do={ + :if ($MessageVal->"topics" ~ "(warning)") do={ :set Warning true; + :set Bullet "large-orange-circle"; + } + :if ($MessageVal->"topics" ~ "(emergency|alert|critical|error)") do={ + :set Bullet "large-red-circle"; } :if ($DupCount < 3) do={ - :set Messages ($Messages . "\n" . [ $IfThenElse ($NotificationsWithSymbols = true) (" \E2\97\8F ") ] . \ + :set Messages ($Messages . "\n" . [ $SymbolForNotification $Bullet ] . \ $MessageVal->"time" . " " . [ :tostr ($MessageVal->"topics") ] . " " . $MessageVal->"message"); } else={ :set Duplicates true; |