sd-bus: when debug logging about messages, show the same bits of it everywhere

Also, include the message signature everywhere.
This commit is contained in:
Lennart Poettering 2017-12-12 23:23:25 +01:00
parent 665dfe9318
commit e32fd6b47c
2 changed files with 14 additions and 7 deletions

View file

@ -362,13 +362,18 @@ int bus_maybe_reply_error(sd_bus_message *m, int r, sd_bus_error *error) {
} else } else
return r; return r;
log_debug("Failed to process message [type=%s sender=%s path=%s interface=%s member=%s signature=%s]: %s", log_debug("Failed to process message type=%s sender=%s destination=%s path=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " signature=%s error-name=%s error-message=%s: %s",
bus_message_type_to_string(m->header->type), bus_message_type_to_string(m->header->type),
strna(m->sender), strna(sd_bus_message_get_sender(m)),
strna(m->path), strna(sd_bus_message_get_destination(m)),
strna(m->interface), strna(sd_bus_message_get_path(m)),
strna(m->member), strna(sd_bus_message_get_interface(m)),
strna(sd_bus_message_get_member(m)),
BUS_MESSAGE_COOKIE(m),
m->reply_cookie,
strna(m->root_container.signature), strna(m->root_container.signature),
strna(m->error.name),
strna(m->error.message),
bus_error_message(error, r)); bus_error_message(error, r));
return 1; return 1;

View file

@ -57,7 +57,7 @@
#define log_debug_bus_message(m) \ #define log_debug_bus_message(m) \
do { \ do { \
sd_bus_message *_mm = (m); \ 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-name=%s error-message=%s", \ log_debug("Got message type=%s sender=%s destination=%s path=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " signature=%s error-name=%s error-message=%s", \
bus_message_type_to_string(_mm->header->type), \ bus_message_type_to_string(_mm->header->type), \
strna(sd_bus_message_get_sender(_mm)), \ strna(sd_bus_message_get_sender(_mm)), \
strna(sd_bus_message_get_destination(_mm)), \ strna(sd_bus_message_get_destination(_mm)), \
@ -66,6 +66,7 @@
strna(sd_bus_message_get_member(_mm)), \ strna(sd_bus_message_get_member(_mm)), \
BUS_MESSAGE_COOKIE(_mm), \ BUS_MESSAGE_COOKIE(_mm), \
_mm->reply_cookie, \ _mm->reply_cookie, \
strna(_mm->root_container.signature), \
strna(_mm->error.name), \ strna(_mm->error.name), \
strna(_mm->error.message)); \ strna(_mm->error.message)); \
} while (false) } while (false)
@ -1467,7 +1468,7 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call
return r; return r;
if (*idx >= BUS_MESSAGE_SIZE(m)) 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-name=%s error-message=%s", log_debug("Sent message type=%s sender=%s destination=%s path=%s interface=%s member=%s cookie=%" PRIu64 " reply_cookie=%" PRIu64 " signature=%s error-name=%s error-message=%s",
bus_message_type_to_string(m->header->type), bus_message_type_to_string(m->header->type),
strna(sd_bus_message_get_sender(m)), strna(sd_bus_message_get_sender(m)),
strna(sd_bus_message_get_destination(m)), strna(sd_bus_message_get_destination(m)),
@ -1476,6 +1477,7 @@ static int bus_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call
strna(sd_bus_message_get_member(m)), strna(sd_bus_message_get_member(m)),
BUS_MESSAGE_COOKIE(m), BUS_MESSAGE_COOKIE(m),
m->reply_cookie, m->reply_cookie,
strna(m->root_container.signature),
strna(m->error.name), strna(m->error.name),
strna(m->error.message)); strna(m->error.message));