Commit e900f58c335d481fed168e00d2a47c0367eab1fb:
Messages may occur multiple times
Add basic Wunderbar warn check
Branch: refs/heads/master
Author: Sebb <[email protected]>
Committer: Sebb <[email protected]>
Pusher: sebb <[email protected]>
------------------------------------------------------------
www/status/monitors/public_json.rb | +++++++ --
------------------------------------------------------------
9 changes: 7 additions, 2 deletions.
------------------------------------------------------------
diff --git a/www/status/monitors/public_json.rb
b/www/status/monitors/public_json.rb
index a9858e1..39eb31b 100644
--- a/www/status/monitors/public_json.rb
+++ b/www/status/monitors/public_json.rb
@@ -18,8 +18,13 @@ def Monitor.public_json(previous_status)
contents = File.read(log, encoding: Encoding::UTF_8)
- # Ignore Wunderbar logging for normal messages (TODO ignore _WARN ?)
- contents.sub! /^(_INFO|_DEBUG) .*\n+/, ''
+ # Ignore Wunderbar logging for normal messages (may occur multiple times)
+ contents.gsub! /^(_INFO|_DEBUG) .*\n+/, ''
+
+ # Wunderbar warning (TODO - extract the text and return it?)
+ if contents.gsub! /^_WARN .*?\n+/, ''
+ status[name].merge! level: 'warning', title: 'warning'
+ end
# diff -u output:
if contents.sub! /^--- .*?\n(\n|\Z)/m, ''