Commit 6aa17505 authored by thomas.forbriger's avatar thomas.forbriger Committed by Checksum Backup @bromo

csbackntfy: print reasonable error message in case of missing keyword

parent 2f899dfb
......@@ -44,6 +44,8 @@
# 01/03/2013 V0.8 Improve error handling and use error codes
# 17/03/2013 V0.8.1 show number of critical and error entries in mail
# 01/09/2014 V0.9 (thof) use local mail transfer agent
# 02/08/2019 V0.10 (thof) print reasonable error meassage if non of the
# message level keywords is found
#
# =============================================================================
"""
......@@ -65,7 +67,7 @@ import csbackErrorCodes as eCodes
from email.mime.text import MIMEText
from collections import deque
__version__ = "V0.9"
__version__ = "V0.10"
__subversion__ = "$Id$"
__license__ = "GPLv2+"
__author__ = "Daniel Armbruster"
......@@ -283,7 +285,10 @@ def main(argv=None):
elif 'INFO' in line:
infoDeque.appendleft("logfile: "+path+"\n"+line)
else:
logger.getLogger().info("Illegal line in logfile found: '"+line+"'")
logger.getLogger().info(("Illegal line in logfile found\n"
+" Line does not contain any of the csback message level keywords\n"
+" %s %s %s %s\n The log line is:\n %s")
% ("CRITICAL", "ERROR", "WARNING", "INFO", line))
except IOError as err:
raise Error("Error while reading logfiles: "+err.filename, \
eCodes.NTFY_IOError)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment