From fe2c4ef6c8e3639654bb3b44f25980a2eb8c6bab Mon Sep 17 00:00:00 2001 From: Alexander Schmidt Date: Tue, 6 Oct 2020 22:59:56 +0200 Subject: [PATCH] formatting alert message --- src/logalert.py | 1 - src/misc.py | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/logalert.py b/src/logalert.py index 73e5660..c130358 100755 --- a/src/logalert.py +++ b/src/logalert.py @@ -78,7 +78,6 @@ for line in misc.follow_file(args.logfile): misc.create_msg("Log Alert", "☠", args.logfile, - "Number of errors exceeded!", lines) ) if not error_state: logging.warning("Entering error state!") diff --git a/src/misc.py b/src/misc.py index 821159f..959fd57 100644 --- a/src/misc.py +++ b/src/misc.py @@ -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 = "%s %s %s" % (title, logfile, icon) - msg += "
%s" % text +def create_msg(title, icon, logfile, lines): + msg = "%s %s" % (title, icon) + msg += "
Too many errors in %s!" % logfile msg += "
"
     for line in lines: msg += line + "\n"
     msg += "
" -- 2.39.5