def log_error(msg, is_send_mail=True):
    if traceback:
        msg = msg + '\n' + traceback.format_exc() + '\n'
    # 获取程序当前运行的堆栈信息
    detailtrace = except_helper.detailtrace()
    msg = msg + '程序调用堆栈的日志:' + detailtrace + '\n'
    logger.error(msg)

    # 发送邮件通知相关人员
    if is_send_mail:
        info = mail_helper.send_error_mail(context=msg)
        if info: logging.info(info)
Example #2
0
def error(content = '', is_send_mail = True):
    """记录错误日志信息"""
    if traceback:
        content = content + '\n' + traceback.format_exc() + '\n'
    # 获取程序当前运行的堆栈信息
    detailtrace = except_helper.detailtrace()
    content = content + '程序调用堆栈的日志:' + detailtrace + '\n'

    logging.info(content)

    # 发送邮件通知相关人员
    if is_send_mail:
        info = mail_helper.send_error_mail(context=content)
        if info: logging.info(info)
Example #3
0
 def test(self):
     mail_helper.send_mail('test', 'test', '*****@*****.**')
     except_info = except_helper.detailtrace()
     mail_helper.send_error_mail('出现异常,堆栈信息:' + except_info)
 def test(self):
     str = mail_helper.send_mail('test', 'test', '*****@*****.**')
     print(str)
     except_info = except_helper.detailtrace()
     mail_helper.send_error_mail('出现异常,堆栈信息:' + except_info)
Example #5
0
 def test(self):
     print(except_helper.detailtrace())
 def test(self):
     mail_helper.send_mail('test', 'test', '*****@*****.**')
     except_info = except_helper.detailtrace()
     mail_helper.send_error_mail('出现异常,堆栈信息' + except_info)