log: Convert log values to printf() if not enabled
authorSimon Glass <sjg@chromium.org>
Sat, 8 May 2021 19:46:54 +0000 (13:46 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 8 Jun 2021 15:39:09 +0000 (11:39 -0400)
commite1cbd916c86cbfdb87a7b2219624057428c285d4
tree338db8b14138d67a2969b677258873c30aa8f03e
parent8d9bb98f8649222777193c6c161361e1ebd5e3fa
log: Convert log values to printf() if not enabled

At present if logging not enabled, log_info() becomes a nop. But we want
log output at the 'info' level to be akin to printf(). Update the macro to
pass the output straight to printf() in this case.

This mimics the behaviour for the log_...() macros like log_debug() and
log_info(), so we can drop the special case for these.

Add new tests to cover this case.
Signed-off-by: Simon Glass <sjg@chromium.org>
doc/develop/logging.rst
include/log.h
test/log/Makefile
test/log/nolog_ndebug.c [new file with mode: 0644]
test/log/nolog_test.c