From: Alexander Schmidt Date: Tue, 6 Oct 2020 20:59:56 +0000 (+0200) Subject: formatting alert message X-Git-Url: http://git.treefish.org/~alex/logalert.git/commitdiff_plain/HEAD formatting alert message --- 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 += "
"