log: Add helpers for common log levels
authorSimon Glass <sjg@chromium.org>
Mon, 1 Oct 2018 17:55:06 +0000 (11:55 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Oct 2018 10:40:26 +0000 (04:40 -0600)
commitcdd140af5c6b623d31ac87a8054cee55fb70d3f0
tree2611fa049af667c73e353be43fb8a5aa11c4c7f1
parentfbcf37e48ebb9829c85651378191e33f6ece710e
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>
configs/sandbox_flattree_defconfig
include/log.h
test/log/log_test.c
test/py/tests/test_log.py