mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
log.get_caller_pos(): Implement frames > 1
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
c2f229c95c
commit
08f9aae61a
1 changed files with 2 additions and 3 deletions
|
|
@ -75,9 +75,8 @@ _prio_colors = {
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_caller_pos(up = 1):
|
def get_caller_pos(up = 1):
|
||||||
assert(up == 1) # TODO: implement this
|
caller = inspect.stack()[up+1]
|
||||||
caller_frame = inspect.currentframe().f_back.f_back
|
return (basename(caller.filename), caller.lineno)
|
||||||
return (basename(caller_frame.f_code.co_filename), caller_frame.f_lineno)
|
|
||||||
|
|
||||||
def slog_m(prio, *args, **kwargs): # export
|
def slog_m(prio, *args, **kwargs): # export
|
||||||
if prio > _level:
|
if prio > _level:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue