All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] log: Allow multiple lines and conversion to printf()
@ 2021-01-21  3:10 Simon Glass
  2021-01-21  3:10 ` [PATCH v2 1/6] log: Set up a flag byte for log records Simon Glass
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Simon Glass @ 2021-01-21  3:10 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 v2:
- Move the newline check into log_dispatch()
- 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 (6):
  log: Set up a flag byte for log records
  log: Handle line continuation
  log: Add return-checking macros for 0 being success
  sandbox: log: Avoid build error with !CONFIG_LOG
  tpm: Don't select LOG
  log: Convert log values to printf() if not enabled

 cmd/Kconfig                       |  1 -
 common/log.c                      | 16 +++++--
 common/log_console.c              | 26 +++++++-----
 configs/sandbox_defconfig         | 15 ++++---
 doc/develop/logging.rst           | 37 +++++++++++++++--
 include/asm-generic/global_data.h |  6 +++
 include/log.h                     | 69 ++++++++++++++++++++-----------
 test/log/Makefile                 |  3 +-
 test/log/cont_test.c              | 19 +++++++--
 test/log/nolog_ndebug.c           | 38 +++++++++++++++++
 test/log/nolog_test.c             |  3 ++
 11 files changed, 178 insertions(+), 55 deletions(-)
 create mode 100644 test/log/nolog_ndebug.c

-- 
2.30.0.296.g2bfb1c46d8-goog

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

end of thread, other threads:[~2021-03-15 15:52 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-21  3:10 [PATCH v2 0/6] log: Allow multiple lines and conversion to printf() Simon Glass
2021-01-21  3:10 ` [PATCH v2 1/6] log: Set up a flag byte for log records Simon Glass
2021-03-15 15:52   ` Tom Rini
2021-01-21  3:10 ` [PATCH v2 2/6] log: Handle line continuation Simon Glass
2021-03-15 15:52   ` Tom Rini
2021-01-21  3:10 ` [PATCH v2 3/6] log: Add return-checking macros for 0 being success Simon Glass
2021-03-15 15:52   ` Tom Rini
2021-01-21  3:10 ` [PATCH v2 4/6] sandbox: log: Avoid build error with !CONFIG_LOG Simon Glass
2021-01-21  3:10 ` [PATCH v2 5/6] tpm: Don't select LOG Simon Glass
2021-03-15 15:52   ` Tom Rini
2021-01-21  3:10 ` [PATCH v2 6/6] log: Convert log values to printf() if not enabled Simon Glass
2021-02-05  1:28   ` Sean Anderson
2021-02-05  3:31     ` Simon Glass
2021-03-14 19:33   ` Tom Rini
2021-03-14 20:32     ` Simon Glass
2021-02-05  1:20 ` [PATCH v2 0/6] log: Allow multiple lines and conversion to printf() Simon Glass

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.