Commit 5294a255 authored by Trevor Cappallo's avatar Trevor Cappallo
Browse files

appropriate email log level for crit

parent f85f4775
......@@ -36,17 +36,19 @@ def __exit_handler(logger, notify):
pass
if logger.has_errors():
lev = logging.ERROR
addresses = notify['ERROR']
print "before addresses:", addresses
if notify['DEBUG']:
addresses.extend(notify['DEBUG'])
if logger.has_critical() and notify['CRITICAL']:
lev = logging.CRITICAL
addresses = addresses.extend(notify['CRITICAL'])
if not addresses:
logging.warning('There were errors, but no recipients specified. No email sent.')
else:
addresses = list(set(addresses))
logger.email_log(addresses)
logger.email_log(addresses, level=lev)
print "after addresses", addresses
print "notify =", notify
elif notify['DEBUG']:
......
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