aboutsummaryrefslogtreecommitdiffstats
path: root/selftest
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-13 00:08:35 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-13 13:32:37 +0200
commite4cd7910a544019f6c01ae8a8b5a26e6c85a361e (patch)
tree317560fe26e1408817f329cf6e41a4a124487773 /selftest
parent1a7a3f0e4318bccbd3ed177d5b07fa3618d06868 (diff)
log_test.py: cosmetic follow-up
This is kept separate to not clutter up previous patch I5f9b53150f2bb6fa9d63ce27f0806f0ca6a45e90. Change-Id: I0ce50375fdb028da96c2159d577d8ed1967d4fe6
Diffstat (limited to 'selftest')
-rw-r--r--selftest/log_test.ok28
-rwxr-xr-xselftest/log_test.py5
2 files changed, 15 insertions, 18 deletions
diff --git a/selftest/log_test.ok b/selftest/log_test.ok
index 17198b7..c9d2dd2 100644
--- a/selftest/log_test.ok
+++ b/selftest/log_test.ok
@@ -12,29 +12,29 @@
tst: only category
DBG: only level
some-name(some='detail'): only origin
-only src [log_test.py:70]
+only src [log_test.py:69]
- Testing log.style_change()
no log format
01:02:03: add time
but no time format
01:02:03: DBG: add level
01:02:03 tst: DBG: add category
-01:02:03 tst: DBG: add src [log_test.py:85]
-01:02:03 tst some-name(some='detail'): DBG: add origin [log_test.py:87]
+01:02:03 tst: DBG: add src [log_test.py:84]
+01:02:03 tst some-name(some='detail'): DBG: add origin [log_test.py:86]
- Testing origin_width
-01:02:03 tst shortname: origin str set to 23 chars [log_test.py:94]
-01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): long origin str [log_test.py:96]
-01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): DBG: long origin str dbg [log_test.py:97]
-01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): ERR: long origin str err [log_test.py:98]
+01:02:03 tst shortname: origin str set to 23 chars [log_test.py:91]
+01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): long origin str [log_test.py:93]
+01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): DBG: long origin str dbg [log_test.py:94]
+01:02:03 tst very long name(and_some=(3, 'things', 'in a tuple'), some='details'): ERR: long origin str err [log_test.py:95]
- Testing log.Origin with omitted info
-01:02:03 tst LogTest: hello log, name implicit from class name [log_test.py:103]
-01:02:03 --- explicit_name: hello log, no category set [log_test.py:107]
-01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:110]
-01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:113]
+01:02:03 tst LogTest: hello log, name implicit from class name [log_test.py:99]
+01:02:03 --- explicit_name: hello log, no category set [log_test.py:103]
+01:02:03 --- LogTest: hello log, no category nor name set [log_test.py:107]
+01:02:03 --- LogTest: DBG: debug message, no category nor name set [log_test.py:110]
- Testing logging of Exceptions, tracing origins
nested print just prints
-01:02:03 tst level3: nested log() [level1↪level2↪level3] [log_test.py:135]
-01:02:03 tst level2: nested l2 log() from within l3 scope [level1↪level2] [log_test.py:136]
-01:02:03 tst level3: ERR: ValueError: bork [level1↪level2↪level3] [log_test.py:137: raise ValueError('bork')]
+01:02:03 tst level3: nested log() [level1↪level2↪level3] [log_test.py:132]
+01:02:03 tst level2: nested l2 log() from within l3 scope [level1↪level2] [log_test.py:133]
+01:02:03 tst level3: ERR: ValueError: bork [level1↪level2↪level3] [log_test.py:134: raise ValueError('bork')]
- Disallow origin loops
disallowed successfully
diff --git a/selftest/log_test.py b/selftest/log_test.py
index 9136906..889a8a5 100755
--- a/selftest/log_test.py
+++ b/selftest/log_test.py
@@ -45,7 +45,6 @@ class LogTest(log.Origin):
super().__init__(log.C_TST, *name_items, **detail_items)
t = LogTest('some', 'name', some="detail")
-
t.log("hello log")
t.err("hello err")
@@ -86,8 +85,6 @@ t.dbg("add src")
log.style_change(origin=True)
t.dbg("add origin")
-# some space to keep source line numbers identical to previous code
-
print('- Testing origin_width')
t = LogTest('shortname')
log.style(origin_width=23, time_fmt=fake_time)
@@ -97,7 +94,6 @@ t.log("long origin str")
t.dbg("long origin str dbg")
t.err("long origin str err")
-
print('- Testing log.Origin with omitted info')
t = LogTest()
t.log("hello log, name implicit from class name")
@@ -105,6 +101,7 @@ t.log("hello log, name implicit from class name")
t = LogTest('explicit_name')
t._set_log_category(None)
t.log("hello log, no category set")
+
t = LogTest()
t._set_log_category(None)
t.log("hello log, no category nor name set")