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:
Jan Lindemann 2020-04-04 11:12:11 +02:00
commit 79ebb798c7

View file

@ -88,7 +88,11 @@ def slog_m(prio, *args, **kwargs): # export
margs += '\n'.join([str(elem) for elem in a])
continue
margs += ' ' + str(a)
if 'caller' not in kwargs:
caller = get_caller_pos(1)
else:
caller = kwargs['caller']
del kwargs['caller']
for line in margs[1:].split('\n'):
slog(prio, line, **kwargs, caller=caller)