prevent captured exception from showing when logging other tracebacks
This commit is contained in:
parent
3d7e141e7a
commit
babfe17afb
1 changed files with 3 additions and 4 deletions
|
@ -73,10 +73,9 @@ class JsonFormatter(logging.Formatter):
|
||||||
|
|
||||||
|
|
||||||
def traceback_formatter(*args, **kwargs):
|
def traceback_formatter(*args, **kwargs):
|
||||||
try:
|
level = kwargs.get('level', args[0] if len(args) else None)
|
||||||
level = kwargs.get('level', args[0]).lower()
|
if level:
|
||||||
except:
|
level = level.lower()
|
||||||
level = None
|
|
||||||
if level == 'warn' or level == 'warning':
|
if level == 'warn' or level == 'warning':
|
||||||
logging.getLogger('WakaTime').warning(traceback.format_exc())
|
logging.getLogger('WakaTime').warning(traceback.format_exc())
|
||||||
elif level == 'info':
|
elif level == 'info':
|
||||||
|
|
Loading…
Reference in a new issue