mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 09:21:26 +03:00
sd-bus: when showing brief message info show error name in debug out put too
When debug logging is enabled we show brief information about every bus message we send or receieve. Pretty much all information is shown, except for the error name if a message is an error (interestingly we do print the error text however). Fix that, and add the error name as well.
This commit is contained in:
parent
894fcf91ed
commit
e28d086553
@ -56,7 +56,7 @@
|
||||
#define log_debug_bus_message(m) \
|
||||
do { \
|
||||
sd_bus_message *_mm = (m); \
|
||||
log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s", \
|
||||
log_debug("Got message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error-name=%s error-message=%s", \
|
||||
bus_message_type_to_string(_mm->header->type), \
|
||||
strna(sd_bus_message_get_sender(_mm)), \
|
||||
strna(sd_bus_message_get_destination(_mm)), \
|
||||
@ -65,6 +65,7 @@
|
||||
strna(sd_bus_message_get_member(_mm)), \
|
||||
BUS_MESSAGE_COOKIE(_mm), \
|
||||
_mm->reply_cookie, \
|
||||
strna(_mm->error.name), \
|
||||
strna(_mm->error.message)); \
|
||||
} while (false)
|
||||
|
||||
@ -1465,7 +1466,7 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call
|
||||
return r;
|
||||
|
||||
if (*idx >= BUS_MESSAGE_SIZE(m))
|
||||
log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error=%s",
|
||||
log_debug("Sent message type=%s sender=%s destination=%s object=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " error-name=%s error-message=%s",
|
||||
bus_message_type_to_string(m->header->type),
|
||||
strna(sd_bus_message_get_sender(m)),
|
||||
strna(sd_bus_message_get_destination(m)),
|
||||
@ -1474,6 +1475,7 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call
|
||||
strna(sd_bus_message_get_member(m)),
|
||||
BUS_MESSAGE_COOKIE(m),
|
||||
m->reply_cookie,
|
||||
strna(m->error.name),
|
||||
strna(m->error.message));
|
||||
|
||||
return r;
|
||||
|
Loading…
Reference in New Issue
Block a user