Example #1
0
 def wrapped(*args, **kwargs):
     SL.addFilter(f)
     res = None
     try:
         res = fn(*args, **kwargs)
     except Exception:
         if dump_on_exception:
             print(colors.red("Got exception"))
             for r in f.records:
                 msg = "[%s]" % r.levelname
                 msg += " : %s" % r.msg
                 print(msg)
             print(colors.red("end of logs"))
         raise
     finally:
         SL.removeFilter(f)
     return res
Example #2
0
def error_msg(msg):
    """
    return with error msg
    """
    print(colors.red(msg))
    return ERROR