]> git.baikalelectronics.ru Git - uboot.git/commit
log: Allow LOG_DEBUG to always enable log output
authorSimon Glass <sjg@chromium.org>
Sat, 12 Sep 2020 17:13:34 +0000 (11:13 -0600)
committerTom Rini <trini@konsulko.com>
Sat, 10 Oct 2020 20:49:58 +0000 (16:49 -0400)
commit5c6d011622c59e050bc949167b8fca7ade10c687
tree949ff257975a134f8fbf923debec6f8bd013cce6
parent272e2b5c2c7d024dd75f8bf86b255a574f3ba455
log: Allow LOG_DEBUG to always enable log output

At present if CONFIG_LOG enabled, putting LOG_DEBUG at the top of a file
(before log.h inclusion) causes _log() to be executed for every log()
call, regardless of the build- or run-time logging level.

However there is no guarantee that the log record will actually be
displayed. If the current log level is lower than LOGL_DEBUG then it will
not be.

Add a way to signal that the log record should always be displayed and
update log_passes_filters() to handle this.

With the new behaviour, log_debug() will always log if LOG_DEBUG is
enabled.

Move log_test_syslog_nodebug() into its own file since it cannot be made
to work where it is, with LOG_DEBUG defined.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/log.c
doc/README.log
include/log.h
test/log/Makefile
test/log/syslog_test.c
test/log/syslog_test.h [new file with mode: 0644]
test/log/syslog_test_ndebug.c [new file with mode: 0644]