summaryrefslogtreecommitdiff
path: root/test/py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-01 11:55:06 -0600
committerSimon Glass <sjg@chromium.org>2018-10-09 04:40:26 -0600
commitcdd140af5c6b623d31ac87a8054cee55fb70d3f0 (patch)
tree2611fa049af667c73e353be43fb8a5aa11c4c7f1 /test/py
parentfbcf37e48ebb9829c85651378191e33f6ece710e (diff)
log: Add helpers for common log levels
At present to output a log message you need something like: log(UCLASS_SPI, LOCL_INFO, "message1"); log(UCLASS_SPI, LOCL_INFO, "message2"); but many files use the same category throughout. Also it is helpful to shorten the length of log names, providing helpers for common logging levels. Add some macros so that it is possible to do: (top of file, before #includes) #define LOG_CATEGORY UCLASS_SPI (later in the file) log_info("message1"); log_debug("message2"); log_err("message3"); Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/py')
-rw-r--r--test/py/tests/test_log.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/py/tests/test_log.py b/test/py/tests/test_log.py
index 605275b039..cb183444c6 100644
--- a/test/py/tests/test_log.py
+++ b/test/py/tests/test_log.py
@@ -85,6 +85,11 @@ def test_log(u_boot_console):
lines = run_test(9)
check_log_entries(lines, 3)
+ def test10():
+ lines = run_test(10)
+ for i in range(7):
+ assert 'log_test() level %d' % i == lines.next()
+
# TODO(sjg@chromium.org): Consider structuring this as separate tests
cons = u_boot_console
test0()
@@ -97,6 +102,7 @@ def test_log(u_boot_console):
test7()
test8()
test9()
+ test10()
@pytest.mark.buildconfigspec('cmd_log')
def test_log_format(u_boot_console):