def notify(msg, level='INFO', error=False, uptime=0, out=sys.stdout):
"""Manage notifications
args:
msg (str): The message to log.
level (str): The priority level for the message. (Default: INFO)
See :mod:`syslog` for more options.
error (bool): Flag if this is an error condition.
"""
if SYSLOG:
log(msg, level, error)
if SNMP:
send_trap(SNMP_SETTINGS, msg, uptime=uptime, test=False)
if out != sys.stdout:
out.write(msg)
评论列表
文章目录