]> git.ipfire.org Git - thirdparty/systemd.git/commit
json-util: fine tune json_dispatch_log_level()
authorLennart Poettering <lennart@poettering.net>
Tue, 7 Jan 2025 13:24:33 +0000 (14:24 +0100)
committerLennart Poettering <lennart@poettering.net>
Sat, 18 Jan 2025 22:24:29 +0000 (23:24 +0100)
commitfa3137f9d05a9574d795bd0db7ba3abc595f06c4
treeefba33d4ce5ff9bc22bbb686cb887e56d717f1d1
parenta153d7cbd20478fb2dad10d889863f8303542cf8
json-util: fine tune json_dispatch_log_level()

Let's give the user control on how to handle JSON "null" assignments of
the log level. As one of three cases: as failure, as LOG_NULL (i.e. to
turn off logging) or as LOG_INFO (as our usual default log level).

Let's then use that in the generic SetLogLevel() call, so that callers
can use it to explicitly turn off logging in a service.

Note that this was (probably accidentally) already implemented, except
that the introspection enforcement blocked it. Let's clean this up and
make this officially a thing, since it's generally useful to turn off
logging I think.
src/basic/log.h
src/libsystemd/sd-json/json-util.c
src/shared/varlink-io.systemd.service.c