summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-03-21 14:51:56 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-03-21 14:54:04 +0100
commit81b3565efdb08df93596cc7a79ece57b528a69f3 (patch)
treed2981acd639cb313d15a832e2d7a99de4c7467cf /src/libsystemd
parent883354532cb6f050baf86511fa59baf908391714 (diff)
downloadsystemd-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.c2
-rw-r--r--src/libsystemd/sd-device/device-monitor.c2
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);