]> git.ipfire.org Git - thirdparty/systemd.git/commit
timedate: Drop custom logging macros in favor of log context
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 7 Apr 2025 20:06:54 +0000 (22:06 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 23 Apr 2025 12:46:46 +0000 (14:46 +0200)
commita94d0e31779318bcfe2c125dbe8ec14bf31e43c6
tree77a24d6d10f97e10bc4ef07487e5ad92e8679cbc
parentba77798bbab2665fd9cb56bf5d32276ad39d3b4a
timedate: Drop custom logging macros in favor of log context

Additionally, using the log context makes sure the extra fields are
applied to all log messages generated while the context is in place,
rather than only log messages logged with log_unit_xxx() in timedated
itself.

It also means the unit name is prefixed to all log messages logged
within that context. While it's not clear whether we always want the
unit name to be attached to library log messages, we also don't want
the unit name to not be attached to any library log messages, so we opt
to add more rather than less information by adding the unit name everywhere
for now.

In the future we can look into some log.h helpers to enable/disable
adding the prefix to the following log messages or not.
src/timedate/timedated.c