From 79ebb798c70bbc0f43d8809ece5bb94d9ba87adb Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Sat, 4 Apr 2020 11:12:11 +0200 Subject: [PATCH] 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 --- tools/python/jwutils/log.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/python/jwutils/log.py b/tools/python/jwutils/log.py index 4f550e6..07fea2e 100644 --- a/tools/python/jwutils/log.py +++ b/tools/python/jwutils/log.py @@ -88,7 +88,11 @@ def slog_m(prio, *args, **kwargs): # export margs += '\n'.join([str(elem) for elem in a]) continue margs += ' ' + str(a) - caller = get_caller_pos(1) + 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)