def test_logging_bg(self): logger = logging.getLogger("GMailBackgroundLogger") logger.setLevel(logging.DEBUG) gh = GMailHandler(os.environ["GMAIL_ACCOUNT"], os.environ["GMAIL_PASSWD"], os.environ["GMAIL_RCPT"], True) gh.setLevel(logging.DEBUG) logger.addHandler(gh) logger.error("Background Error Message") gh.close()
def test_logging(self): logger = logging.getLogger("GMailLogger") logger.setLevel(logging.DEBUG) gh = GMailHandler(os.environ["GMAIL_ACCOUNT"], os.environ["GMAIL_PASSWD"], os.environ["GMAIL_RCPT"], False) gh.setLevel(logging.DEBUG) logger.addHandler(gh) logger.debug("Debug Message") logger.info("Info Message") logger.warn("Warn Message") logger.error("Error Message") try: 1 / 0 except Exception, e: logger.exception(e)
def test_logging(self): logger = logging.getLogger("GMailLogger") logger.setLevel(logging.DEBUG) gh = GMailHandler(os.environ['GMAIL_ACCOUNT'], os.environ['GMAIL_PASSWD'], os.environ['GMAIL_RCPT'], False) gh.setLevel(logging.DEBUG) logger.addHandler(gh) logger.debug("Debug Message") logger.info("Info Message") logger.warn("Warn Message") logger.error("Error Message") try: 1/0 except Exception,e: logger.exception(e)
def test_logging_bg(self): logger = logging.getLogger("GMailBackgroundLogger") logger.setLevel(logging.DEBUG) gh = GMailHandler(os.environ['GMAIL_ACCOUNT'], os.environ['GMAIL_PASSWD'], os.environ['GMAIL_RCPT'], True) gh.setLevel(logging.DEBUG) logger.addHandler(gh) logger.error("Background Error Message") gh.close()