Skip to content

Instantly share code, notes, and snippets.

View wd's full-sized avatar

Dong Wang wd

View GitHub Profile
@papaben
papaben / get_log_traceback.py
Created November 6, 2018 16:31
Figure out who disabled your logger
def _get_trace():
trace = u''
depth = 2 # skip call to this function
while True:
try:
frame = sys._getframe(depth)
trace = u'%s:%s\n%s' % (
frame.f_code.co_filename, frame.f_lineno, trace
)
depth += 1