diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-03-21 14:51:56 +0100 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-03-21 14:54:04 +0100 |
commit | 81b3565efdb08df93596cc7a79ece57b528a69f3 (patch) | |
tree | d2981acd639cb313d15a832e2d7a99de4c7467cf /src/libsystemd | |
parent | 883354532cb6f050baf86511fa59baf908391714 (diff) | |
download | systemd-81b3565efdb08df93596cc7a79ece57b528a69f3.tar.gz |
log: Add key/value support to the log context
Now that we have reference counting, it's useful to be able to push
single key values onto the log context separately, so that we don't
have to allocate new storage to join the separate string together into
a single field which means we won't be able to reuse a context containing
the same field.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 2 | ||||
-rw-r--r-- | src/libsystemd/sd-device/device-monitor.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 4387db3841..6ee8bb7a7f 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -2950,7 +2950,7 @@ static int process_message(sd_bus *bus, sd_bus_message *m) { bus->iteration_counter++; if (log_context_enabled()) - c = log_context_new_consume(bus_message_make_log_fields(m)); + c = log_context_new_strv_consume(bus_message_make_log_fields(m)); log_debug_bus_message(m); diff --git a/src/libsystemd/sd-device/device-monitor.c b/src/libsystemd/sd-device/device-monitor.c index 1d8b7550b6..af093385da 100644 --- a/src/libsystemd/sd-device/device-monitor.c +++ b/src/libsystemd/sd-device/device-monitor.c @@ -249,7 +249,7 @@ static int device_monitor_event_handler(sd_event_source *s, int fd, uint32_t rev return 0; if (log_context_enabled()) - c = log_context_new_consume(device_make_log_fields(device)); + c = log_context_new_strv_consume(device_make_log_fields(device)); if (m->callback) return m->callback(m, device, m->userdata); |