Closed smcv closed 1 month ago
Updated: while reviewing a similar change in libcapsule, @refi64 pointed out that I'd described the prefixes as "syslog-style" here, but not in libcapsule. In fact saying "syslog-style" is misleading, because https://datatracker.ietf.org/doc/html/rfc5424#section-6.2 describes a prefix that encodes both the severity and the facility, whereas here we're using only the severity, in order to be compatible with systemd-cat(1)
. Consistently say "severity" in preference to "priority" to reflect this.
(Documentation updates only; the only code change is to rename a level
function parameter to severity
.)
Any thoughts on this from other maintainers? My colleague @refi64 already provided some useful feedback, which I've addressed.
I'm not a maintainer, but FWIW this looks good to me as well.
test-run: Assert that repeating --chdir logs a warning
This is the case since commit 0d369cd "main: Warn when non-repeatable options are repeated".
utils: Put nearly all diagnostic output through a common log function
This takes a syslog-style severity level, allowing us to act based on the severity.
Take the opportunity to make the
__debug__
macro (which normally expands to nothing, but can be enabled by changing a#if 0
to#if 1
) less weird and easier to use, by taking it out of the reserved-for-the-compiler namespace, adding a newline automatically, and not requiring nested parentheses.Add new --level-prefix option
This prepends a syslog-style priority level such as <3> to each line of diagnostic output, so that the diagnostic output can be parsed by tools like
systemd-cat --level-prefix=1
. A future version of Steam's pressure-vessel is likely to use this to make warnings and fatal errors from bubblewrap more visible.cc @refi64 @RyuzakiKK