All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/2] log: Allow multiple lines and conversion to printf()
@ 2021-05-08 19:46 Simon Glass
  2021-05-08 19:46 ` [PATCH v4 1/2] sandbox: log: Avoid build error with !CONFIG_LOG Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Glass @ 2021-05-08 19:46 UTC (permalink / raw)
  To: u-boot

At present when logging is not enabled, all log() calls become nops. This
does not seem right, since if the log level is high enough then there
should be some sort of message. So in that case, this series updates it to
print the message if the log level is above LOGL_INFO.

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

Also the current implementation does not support multiple log calls on the
same line nicely. The tags are repeated so the line is very hard to read.
This series adds that as a new feature.

Changes in v4:
- Fix missing header for SPL

Changes in v3:
- Rebase on hexdump series
  http://patchwork.ozlabs.org/project/uboot/list/?series=242818

Changes in v2:
- Update commit message and cover letter to mention log_...() macros
- Add a test for !CONFIG_LOG
- Update log() to (effectively) call debug() for log_level == LOGL_DEBUG

Simon Glass (2):
  sandbox: log: Avoid build error with !CONFIG_LOG
  log: Convert log values to printf() if not enabled

 configs/sandbox_defconfig |  1 +
 doc/develop/logging.rst   |  6 ++++--
 include/log.h             | 34 +++++++++++++++-------------------
 test/log/Makefile         |  2 ++
 test/log/nolog_ndebug.c   | 39 +++++++++++++++++++++++++++++++++++++++
 test/log/nolog_test.c     |  3 +++
 6 files changed, 64 insertions(+), 21 deletions(-)
 create mode 100644 test/log/nolog_ndebug.c

-- 
2.31.1.607.g51e8a6a459-goog

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-08 21:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-08 19:46 [PATCH v4 0/2] log: Allow multiple lines and conversion to printf() Simon Glass
2021-05-08 19:46 ` [PATCH v4 1/2] sandbox: log: Avoid build error with !CONFIG_LOG Simon Glass
2021-05-08 19:46 ` [PATCH v4 2/2] log: Convert log values to printf() if not enabled Simon Glass
2021-06-08 21:43 ` [PATCH v4 0/2] log: Allow multiple lines and conversion to printf() Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.