def init_logging(): root = logging.getLogger() root.setLevel(logging.ERROR) handler = TLSSMTPHandler( ('smtp.gmail.com', 587), 'Uptime Monitor <*****@*****.**>', RECIPIENTS, 'add subject here', (SMTP_USER, SMTP_PASS) ) handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')) root.addHandler(handler)
def init_logging(): root = logging.getLogger() root.setLevel(logging.ERROR) handler = TLSSMTPHandler( ("smtp.gmail.com", 587), "Uptime Monitor <*****@*****.**>", RECIPIENTS, "add subject here", (SMTP_USER, SMTP_PASS), ) handler.setFormatter(logging.Formatter("%(asctime)s:%(levelname)s:%(message)s")) root.addHandler(handler)
def init_logging(): try: un, pw = get_email_credentials() except Exception: logging.error("No localemailsettings file found. Email notifications will not be sent") return root = logging.getLogger() root.setLevel(logging.ERROR) handler = TLSSMTPHandler( ('smtp.gmail.com', 587), 'Uptime Monitor <%s>' % un, RECIPIENTS, 'BHOMA Server Error', (un, pw) ) handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')) root.addHandler(handler)