def filter(self, record):
# skip this function
stack = inspect.stack()[1:]
for i, (frame, path, ln, func, line, xx) in enumerate(stack):
if (frame.f_globals.get('__name__') == 'pykit.ututil'
and func == 'dd'):
# this frame is dd(), find the caller
_, path, ln, func, line, xx = stack[i + 1]
record._fn = os.path.basename(path)
record._ln = ln
record._func = func
return True
record._fn = record.filename
record._ln = record.lineno
record._func = record.funcName
return True
评论列表
文章目录