[Bug 37803] Debug output should include user-readable enum names

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Jul 25 19:22:29 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=37803

--- Comment #5 from Will Thompson <will.thompson at collabora.co.uk> 2011-07-25 10:22:28 PDT ---
+
+/**
+ * _tp_enum_to_nick:

Don't use double-stars for internal functions.

+        self.caps_header = '__%s_H__' % output_base.upper().replace('-', '_')\
+                .replace('/', '_')

Strictly speaking __ is reserved for the toolchain, so header guards like
__TP_FOO_H__ should be TP_FOO_H. I am in a minority in caring about this.


-  DEBUG("emitting status-changed to %u, for reason %u", status, reason);
+  DEBUG("emitting status-changed to %s (%d), for reason %s (%d)",
+      _tp_enum_to_nick (TP_TYPE_CONNECTION_STATUS, status), status,
+      _tp_enum_to_nick (TP_TYPE_CONNECTION_STATUS_REASON, reason), reason);
   tp_svc_connection_emit_status_changed (self, status, reason);

You'll want to special case calls to _tp_enum_to_nick
(TP_TYPE_CONNECTION_STATUS, x) in base-connection: there's a special
internal-only value. See also bug 35736 which tries to make these more
beautiful.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list