]> git.treefish.org Git - logalert.git/commitdiff
formatting alert message master
authorAlexander Schmidt <alex@treefish.org>
Tue, 6 Oct 2020 20:59:56 +0000 (22:59 +0200)
committerAlexander Schmidt <alex@treefish.org>
Tue, 6 Oct 2020 20:59:56 +0000 (22:59 +0200)
src/logalert.py
src/misc.py

index 73e56604d065233e39f373869539b4231652f955..c1303588b16c14e3ea9b2e81df77158db7faabf9 100755 (executable)
@@ -78,7 +78,6 @@ for line in misc.follow_file(args.logfile):
                                misc.create_msg("Log Alert",
                                                "&#9760;",
                                                args.logfile,
-                                               "Number of errors exceeded!",
                                                lines) )
         if not error_state:
             logging.warning("Entering error state!")
index 821159f0bfa93c18617dfd3c09545173fef97914..959fd57a38647a9a4e676cdb86103963f3a72cc8 100644 (file)
@@ -41,9 +41,9 @@ def feed_handler(cmd, data):
     except Exception as e:
         logging.error("Error feeding handler: %s" % str(e))
 
-def create_msg(title, icon, logfile, text, lines):
-    msg = "<b>%s</b> <i>%s</i> %s" % (title, logfile, icon)
-    msg += "<br>%s" % text
+def create_msg(title, icon, logfile, lines):
+    msg = "<b>%s</b> %s" % (title, icon)
+    msg += "<br>Too many errors in <i>%s</i>!" % logfile
     msg += "<br><pre>"
     for line in lines: msg += line + "\n"
     msg += "</pre>"