mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
slog_m(): Support kwarg "caller"
Treat slog_m() to a caller keyword argument, up to now only supported by slog(). Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
70bfb51948
commit
79ebb798c7
1 changed files with 5 additions and 1 deletions
|
|
@ -88,7 +88,11 @@ def slog_m(prio, *args, **kwargs): # export
|
||||||
margs += '\n'.join([str(elem) for elem in a])
|
margs += '\n'.join([str(elem) for elem in a])
|
||||||
continue
|
continue
|
||||||
margs += ' ' + str(a)
|
margs += ' ' + str(a)
|
||||||
|
if 'caller' not in kwargs:
|
||||||
caller = get_caller_pos(1)
|
caller = get_caller_pos(1)
|
||||||
|
else:
|
||||||
|
caller = kwargs['caller']
|
||||||
|
del kwargs['caller']
|
||||||
for line in margs[1:].split('\n'):
|
for line in margs[1:].split('\n'):
|
||||||
slog(prio, line, **kwargs, caller=caller)
|
slog(prio, line, **kwargs, caller=caller)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue