aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo_gsm_tester/log.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo_gsm_tester/log.py')
-rw-r--r--src/osmo_gsm_tester/log.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/osmo_gsm_tester/log.py b/src/osmo_gsm_tester/log.py
index f56d2c9..3e96999 100644
--- a/src/osmo_gsm_tester/log.py
+++ b/src/osmo_gsm_tester/log.py
@@ -186,6 +186,14 @@ class LogTarget:
log_str = log_str + '\n'
self.log_sink(log_str)
+ def large_separator(self, *msgs):
+ msg = ' '.join(msgs)
+ if not msg:
+ msg = '------------------------------------------'
+ self.log_sink('------------------------------------------\n'
+ '%s\n'
+ '------------------------------------------\n' % msg)
+
targets = [ LogTarget() ]
def level_str(level):
@@ -207,6 +215,10 @@ def _log_all_targets(origin, category, level, src, messages, named_items=None):
for target in targets:
target.log(origin, category, level, src, messages, named_items)
+def large_separator(*msgs):
+ for target in targets:
+ target.large_separator(*msgs)
+
def get_src_from_caller(levels_up=1):
caller = getframeinfo(stack()[levels_up][0])
return '%s:%d' % (os.path.basename(caller.filename), caller.lineno)