prevent captured exception from showing when logging other tracebacks

This commit is contained in:
Alan Hamlett 2016-07-06 16:37:52 +02:00
parent 3d7e141e7a
commit babfe17afb

View file

@ -73,10 +73,9 @@ class JsonFormatter(logging.Formatter):
def traceback_formatter(*args, **kwargs):
try:
level = kwargs.get('level', args[0]).lower()
except:
level = None
level = kwargs.get('level', args[0] if len(args) else None)
if level:
level = level.lower()
if level == 'warn' or level == 'warning':
logging.getLogger('WakaTime').warning(traceback.format_exc())
elif level == 'info':