[PATCH] dbus.proxies: Log more informatively when introspection fails, and use logging rather than just stderr

Simon McVittie simon.mcvittie at collabora.co.uk
Thu May 17 06:32:49 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- ---
 dbus/proxies.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dbus/proxies.py b/dbus/proxies.py
index 354e3b7..440a5d5 100644
- --- a/dbus/proxies.py
+++ b/dbus/proxies.py
@@ -388,12 +388,17 @@ class ProxyObject(object):
             self._introspect_lock.release()
 
     def _introspect_error_handler(self, error):
+        logging.basicConfig()
+        _logger.error("Introspect error on %s:%s: %s.%s: %s",
+                      self._named_service, self.__dbus_object_path__,
+                      error.__class__.__module__, error.__class__.__name__,
+                      error)
         self._introspect_lock.acquire()
         try:
+            _logger.debug('Executing introspect queue due to error')
             self._introspect_state = self.INTROSPECT_STATE_DONT_INTROSPECT
             self._pending_introspect = None
             self._introspect_execute_queue()
- -            sys.stderr.write("Introspect error: " + str(error) + "\n")
         finally:
             self._introspect_lock.release()
 
- -- 
1.5.2-rc3.GIT

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net

iD8DBQFGTFmBWSc8zVUw7HYRAtPDAJ9hNKodrN5yAMgUGpA0v73TqPfhdQCgnr6F
yG7TchCJH1/GjwEEhCJyx+U=
=1dtO
-----END PGP SIGNATURE-----


More information about the dbus mailing list