diff --git a/tools/python/jwutils/log.py b/tools/python/jwutils/log.py index df40cd2..4f550e6 100644 --- a/tools/python/jwutils/log.py +++ b/tools/python/jwutils/log.py @@ -75,9 +75,8 @@ _prio_colors = { } def get_caller_pos(up = 1): - assert(up == 1) # TODO: implement this - caller_frame = inspect.currentframe().f_back.f_back - return (basename(caller_frame.f_code.co_filename), caller_frame.f_lineno) + caller = inspect.stack()[up+1] + return (basename(caller.filename), caller.lineno) def slog_m(prio, *args, **kwargs): # export if prio > _level: