All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] util: configurable / flexible error/log message output format
@ 2026-12-03 17:25 Daniel P. Berrangé
  2026-12-03 17:25 ` [PATCH 1/6] util: pull Location struct and APIs into location.{c,h} Daniel P. Berrangé
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Daniel P. Berrangé @ 2026-12-03 17:25 UTC (permalink / raw)
  To: qemu-devel
  Cc: Markus Armbruster, Dr. David Alan Gilbert, Marc-André Lureau,
	Paolo Bonzini, Daniel P. Berrangé, Peter Maydell,
	Richard Henderson

At the start of the year I had a large series to add more info
to the error / log message output, so we can capture things
like thread names, IDs, and more, with more universal formatting
across both areas of code:

  https://lists.nongnu.org/archive/html/qemu-devel/2026-02/msg03190.html

While much of the early supporting patches merged, Peter was not
convinced by some of the proposed changes, especially where it
affected the default output format:

  https://lists.nongnu.org/archive/html/qemu-devel/2026-02/msg04960.html

I have now re-visited the work and decided on a substantially
different implementation approach.

Aside from Peter's issue, another issue was that the output
format was still substantially hardcoded. While you could turn
off/on individual data items with many new '-msg' flags, there
was no ability to control the order in which they were printed
nor any surrounding separators between fields.

In this new implementation, instead of adding lots of args to
'-msg', there is now a single "format string", which is a mix
of literal text and variable substitions, with some simple
conditions too. This gives the user far better control over
the output format.

Furthermore, the default output format has not been changed at
all from the current state.

So overall this this is a followup to my previous work, I am
calling it version 1, since it is a from scratch implementation.

Daniel P. Berrangé (6):
  util: pull Location struct and APIs into location.{c,h}
  util: add helper to query if a location is set
  util: introduce a configurable message format template
  util: convert log code to support QMessageFormat
  util: convert error report code to use QMessageFormat
  util: add '-msg format=FORMATSTR' argument

 MAINTAINERS                           |  10 +
 chardev/char.c                        |   3 +-
 include/monitor/monitor.h             |   2 +
 include/qemu/error-report.h           |  27 +-
 include/qemu/location.h               |  25 ++
 include/qemu/log.h                    |   3 +
 include/qemu/message-format.h         |  97 ++++++
 monitor/monitor.c                     |  15 +-
 qemu-options.hx                       |  72 ++++-
 stubs/meson.build                     |   1 +
 stubs/monitor-core.c                  |  11 +
 stubs/monitor-puts.c                  |  18 ++
 system/vl.c                           |  35 +-
 tests/unit/meson.build                |   1 +
 tests/unit/test-util-message-format.c | 226 +++++++++++++
 util/error-report.c                   | 232 ++++---------
 util/location.c                       | 137 ++++++++
 util/log.c                            |  32 +-
 util/meson.build                      |   2 +
 util/message-format.c                 | 449 ++++++++++++++++++++++++++
 20 files changed, 1202 insertions(+), 196 deletions(-)
 create mode 100644 include/qemu/location.h
 create mode 100644 include/qemu/message-format.h
 create mode 100644 stubs/monitor-puts.c
 create mode 100644 tests/unit/test-util-message-format.c
 create mode 100644 util/location.c
 create mode 100644 util/message-format.c

-- 
2.56.1



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

end of thread, other threads:[~2026-12-04  9:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 17:25 [PATCH 0/6] util: configurable / flexible error/log message output format Daniel P. Berrangé
2026-12-03 17:25 ` [PATCH 1/6] util: pull Location struct and APIs into location.{c,h} Daniel P. Berrangé
2026-12-03 20:51   ` Eric Blake
2026-12-03 17:25 ` [PATCH 2/6] util: add helper to query if a location is set Daniel P. Berrangé
2026-12-03 20:51   ` Eric Blake
2026-12-03 17:25 ` [PATCH 3/6] util: introduce a configurable message format template Daniel P. Berrangé
2026-12-03 21:44   ` Eric Blake
2026-12-04  9:22     ` Daniel P. Berrangé
2026-12-04  0:32   ` Dr. David Alan Gilbert
2026-12-03 17:25 ` [PATCH 4/6] util: convert log code to support QMessageFormat Daniel P. Berrangé
2026-12-03 21:52   ` Eric Blake
2026-12-03 17:25 ` [PATCH 5/6] util: convert error report code to use QMessageFormat Daniel P. Berrangé
2026-12-03 21:55   ` Eric Blake
2026-12-03 17:25 ` [PATCH 6/6] util: add '-msg format=FORMATSTR' argument Daniel P. Berrangé
2026-12-03 22:02   ` Eric Blake
2026-12-04  9:23     ` Daniel P. Berrangé

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.