GDBus: Add `return' debug option

This prints all GDBusMethodInvocation API usage and is normally used
with the `incoming' option. Example:

 # G_DBUS_DEBUG=incoming,return ./polkitd --replace
 Entering main event loop
 Connected to the system bus
 Registering null backend at priority -10
 [...]
 Acquired the name org.freedesktop.PolicyKit1
 [...]

 ========================================================================
 GDBus-debug:Incoming:
  <<<< METHOD INVOCATION org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       invoked by name :1.26
       serial 299
 ========================================================================
 GDBus-debug:Return:
  >>>> METHOD ERROR org.freedesktop.PolicyKit1.Error.Failed
       message `Cannot determine session the caller is in'
       in response to org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       to name :1.26
       reply-serial 299

 [...]

 ========================================================================
 GDBus-debug:Incoming:
  <<<< METHOD INVOCATION org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       invoked by name :1.2402
       serial 25
 ========================================================================
 GDBus-debug:Return:
  >>>> METHOD RETURN
       in response to org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgent()
       on object /org/freedesktop/PolicyKit1/Authority
       to name :1.2402
       reply-serial 25

Signed-off-by: David Zeuthen <davidz@redhat.com>
This commit is contained in:
David Zeuthen
2010-08-04 16:59:26 -04:00
parent 89a1b571ad
commit d52e1c33f7
5 changed files with 61 additions and 6 deletions

View File

@@ -5883,10 +5883,12 @@ distribute_method_call (GDBusConnection *connection,
"GDBus-debug:Incoming:\n"
" <<<< METHOD INVOCATION %s.%s()\n"
" on object %s\n"
" invoked by name %s\n",
" invoked by name %s\n"
" serial %d\n",
interface_name, member,
path,
g_dbus_message_get_sender (message) != NULL ? g_dbus_message_get_sender (message) : "(none)");
g_dbus_message_get_sender (message) != NULL ? g_dbus_message_get_sender (message) : "(none)",
g_dbus_message_get_serial (message));
_g_dbus_debug_print_unlock ();
}