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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jun 2 23:47:49 CEST 2011


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

David Laban <david.laban at collabora.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://cgit.collabora.com/g
                   |                            |it/user/alsuren/telepathy-g
                   |                            |lib.git/log/?h=human-readab
                   |                            |le-enums
           Keywords|                            |patch

--- Comment #3 from David Laban <david.laban at collabora.co.uk> 2011-06-02 14:47:49 PDT ---
==== Scope Summary ====

I decided not to try converting the error code from GErrors into strings,
because that would require excessive magic. I think the following pattern is as
good as you can get for formatting a GError.
telepathy-glib/account.c:339:          s = g_strdup_printf ("TpAccount was
invalidated: %s #%u: %s",
telepathy-glib/account.c-340-              g_quark_to_string (domain), code,
message);


There were a few things that would be pointless to change because it would
always print "Unrecognised Value". This included pretty much anything in a
"default:" block, like:
examples/cm/callable/media-channel.c:610:          "Stream direction %u is not
valid", stream_direction);


there are a few things that I didn't change because it would require making
_tp_enum_to_nick public (I've listed them here in case you want me to make it
public):

examples/client/extended-client.c:195:  g_message ("Connection status changed
to %u because %u", status, reason);

examples/client/inspect-channel.c:48:  printf ("Handle: of type %u, #%u\n",
handle_type, handle);

examples/client/inspect-connection.c:39:          printf ("\tHandle: type %u,
#%u\n",


There are a few places where bools are formatted as %u that annoyed me (should
really be %s and bool ? "true": "false") but I didn't change them:

telepathy-glib/base-connection.c:870:      "handle=%u, suppress_handler=%u",
request, request->channel_type,
telepathy-glib/base-connection.c:977:      "handle_type=%u, handle=%u,
suppress_handler=%u",

==== Buildsystem Problems ====

I get a lot of noise from g-ir-scanner, but I think that all it is is noise. If
someone with g-ir knowledge could confirm this, that would be quite useful:

/usr/bin/g-ir-scanner -v \
                --namespace TelepathyGLib \
                --nsversion=0.12 \
                --identifier-prefix=Tp \
                -I.. \
                -I.. \
                --include=GLib-2.0 \
                --include=Gio-2.0 \
                --libtool="../libtool" \
                --library=libtelepathy-glib.la \
                --pkg gio-2.0 \
                --pkg dbus-glib-1 \
                --pkg-export telepathy-glib \
                --c-include="telepathy-glib/telepathy-glib.h" \
                --warn-all \
                --output _gen/TelepathyGLib-0.12.gir.tmp \
                ./proxy.c _gen/proxy-introspectable.h ./account.c ./account.h
./account-channel-request.c ./account-channel-request.h ./account-manager.c
./account-manager.h ./automatic-proxy-factory.c ./automatic-proxy-factory.h
./basic-proxy-factory.c ./basic-proxy-factory.h ./client-channel-factory.c
./client-channel-factory.h ./connection.c ./connection.h ./connection-handles.c
./connection-contact-info.c ./protocol.c ./protocol.h ./connection-manager.c
./connection-manager.h ./channel.c ./channel.h ./handle.c ./handle.h
./handle-channels-context.c ./handle-channels-context.h ./dbus-daemon.c
./dbus-daemon.h ./interfaces.c ./intset.c ./intset.h ./dbus.c ./dbus.h
./capabilities.c ./capabilities.h ./contact.c ./contact.h ./contact-search.c
./contact-search.h ./contact-search-result.c ./contact-search-result.h ./defs.h
./debug.c ./debug.h ./base-client.c ./base-client.h ./simple-approver.c
./simple-approver.h ./simple-handler.c ./simple-handler.h ./simple-observer.c
./simple-observer.h ./dbus-properties-mixin.c ./dbus-properties-mixin.h
./contacts-mixin.c ./contacts-mixin.h ./group-mixin.c ./group-mixin.h
./presence-mixin.c ./presence-mixin.h ./channel-dispatch-operation.c
./channel-dispatch-operation.h ./channel-request.c ./channel-request.h
./observe-channels-context.c ./observe-channels-context.h
./add-dispatch-operation-context.c ./add-dispatch-operation-context.h
./protocol.c ./protocol.h ./base-connection.c ./base-connection.h
./handle-repo.c ./handle-repo.h ./handle-set.c ./stream-tube-channel.c
./stream-tube-channel.h ./stream-tube-connection.c ./stream-tube-connection.h
./text-channel.c ./text-channel.h ./client-message.c ./client-message.h
./message.c ./message.h ./signalled-message.c ./signalled-message.h ./errors.c
./errors.h _gen/telepathy-enums.h _gen/telepathy-interfaces.h 
_gen/proxy-introspectable.h:56: Warning: TelepathyGLib:
symbol='NUM_TP_DBUS_ERRORS': Unknown namespace for symbol 'NUM_TP_DBUS_ERRORS'
account-manager.h:100: Warning: TelepathyGLib: symbol='MC5_BUS_NAME': Unknown
namespace for symbol 'MC5_BUS_NAME'
protocol.h:1227: Warning: TelepathyGLib: symbol='PROTOCOL_PREFIX_LEN': Unknown
namespace for symbol 'PROTOCOL_PREFIX_LEN'
protocol.h:1227: Warning: TelepathyGLib: symbol='PROTOCOL_PREFIX_LEN': Unknown
namespace for symbol 'PROTOCOL_PREFIX_LEN'
_gen/telepathy-enums.h:28: Warning: TelepathyGLib:
symbol='NUM_TP_HANDLE_TYPES': Unknown namespace for symbol
'NUM_TP_HANDLE_TYPES'
_gen/telepathy-enums.h:35: Warning: TelepathyGLib:
symbol='NUM_TP_CONNECTION_STATUSES': Unknown namespace for symbol
'NUM_TP_CONNECTION_STATUSES'
_gen/telepathy-enums.h:56: Warning: TelepathyGLib:
symbol='NUM_TP_CONNECTION_STATUS_REASONS': Unknown namespace for symbol
'NUM_TP_CONNECTION_STATUS_REASONS'
_gen/telepathy-enums.h:93: Warning: TelepathyGLib:
symbol='NUM_TP_CONTACT_LIST_STATES': Unknown namespace for symbol
'NUM_TP_CONTACT_LIST_STATES'
_gen/telepathy-enums.h:102: Warning: TelepathyGLib:
symbol='NUM_TP_SUBSCRIPTION_STATES': Unknown namespace for symbol
'NUM_TP_SUBSCRIPTION_STATES'
_gen/telepathy-enums.h:110: Warning: TelepathyGLib:
symbol='NUM_TP_CONTACT_METADATA_STORAGE_TYPES': Unknown namespace for symbol
'NUM_TP_CONTACT_METADATA_STORAGE_TYPES'
_gen/telepathy-enums.h:123: Warning: TelepathyGLib:
symbol='NUM_TP_CONNECTION_PRESENCE_TYPES': Unknown namespace for symbol
'NUM_TP_CONNECTION_PRESENCE_TYPES'
_gen/telepathy-enums.h:134: Warning: TelepathyGLib:
symbol='NUM_TP_ACCESS_CONTROL_TYPES': Unknown namespace for symbol
'NUM_TP_ACCESS_CONTROL_TYPES'
_gen/telepathy-enums.h:142: Warning: TelepathyGLib:
symbol='NUM_TP_RICH_PRESENCE_ACCESS_CONTROL_TYPES': Unknown namespace for
symbol 'NUM_TP_RICH_PRESENCE_ACCESS_CONTROL_TYPES'
_gen/telepathy-enums.h:153: Warning: TelepathyGLib:
symbol='NUM_TP_SERVICE_POINT_TYPES': Unknown namespace for symbol
'NUM_TP_SERVICE_POINT_TYPES'
_gen/telepathy-enums.h:168: Warning: TelepathyGLib:
symbol='NUM_TP_HTTP_METHODS': Unknown namespace for symbol
'NUM_TP_HTTP_METHODS'
_gen/telepathy-enums.h:177: Warning: TelepathyGLib:
symbol='NUM_TP_CHANNEL_CONTACT_SEARCH_STATES': Unknown namespace for symbol
'NUM_TP_CHANNEL_CONTACT_SEARCH_STATES'
_gen/telepathy-enums.h:187: Warning: TelepathyGLib:
symbol='NUM_TP_FILE_TRANSFER_STATES': Unknown namespace for symbol
'NUM_TP_FILE_TRANSFER_STATES'
_gen/telepathy-enums.h:197: Warning: TelepathyGLib:
symbol='NUM_TP_FILE_TRANSFER_STATE_CHANGE_REASONS': Unknown namespace for
symbol 'NUM_TP_FILE_TRANSFER_STATE_CHANGE_REASONS'
_gen/telepathy-enums.h:205: Warning: TelepathyGLib:
symbol='NUM_TP_FILE_HASH_TYPES': Unknown namespace for symbol
'NUM_TP_FILE_HASH_TYPES'
_gen/telepathy-enums.h:211: Warning: TelepathyGLib:
symbol='NUM_TP_MEDIA_STREAM_TYPES': Unknown namespace for symbol
'NUM_TP_MEDIA_STREAM_TYPES'
_gen/telepathy-enums.h:218: Warning: TelepathyGLib:
symbol='NUM_TP_MEDIA_STREAM_STATES': Unknown namespace for symbol
'NUM_TP_MEDIA_STREAM_STATES'
_gen/telepathy-enums.h:226: Warning: TelepathyGLib:
symbol='NUM_TP_MEDIA_STREAM_DIRECTIONS': Unknown namespace for symbol
'NUM_TP_MEDIA_STREAM_DIRECTIONS'
_gen/telepathy-enums.h:250: Warning: TelepathyGLib:
symbol='NUM_TP_CHANNEL_TEXT_SEND_ERRORS': Unknown namespace for symbol
'NUM_TP_CHANNEL_TEXT_SEND_ERRORS'
_gen/telepathy-enums.h:259: Warning: TelepathyGLib:
symbol='NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES': Unknown namespace for symbol
'NUM_TP_CHANNEL_TEXT_MESSAGE_TYPES'
_gen/telepathy-enums.h:272: Warning: TelepathyGLib: symbol='NUM_TP_TUBE_TYPES':
Unknown namespace for symbol 'NUM_TP_TUBE_TYPES'
_gen/telepathy-enums.h:279: Warning: TelepathyGLib:
symbol='NUM_TP_TUBE_STATES': Unknown namespace for symbol 'NUM_TP_TUBE_STATES'
_gen/telepathy-enums.h:297: Warning: TelepathyGLib:
symbol='NUM_TP_CHANNEL_CHAT_STATES': Unknown namespace for symbol
'NUM_TP_CHANNEL_CHAT_STATES'
_gen/telepathy-enums.h:317: Warning: TelepathyGLib:
symbol='NUM_TP_DTMF_EVENTS': Unknown namespace for symbol 'NUM_TP_DTMF_EVENTS'
_gen/telepathy-enums.h:350: Warning: TelepathyGLib:
symbol='NUM_TP_CHANNEL_GROUP_CHANGE_REASONS': Unknown namespace for symbol
'NUM_TP_CHANNEL_GROUP_CHANGE_REASONS'
_gen/telepathy-enums.h:358: Warning: TelepathyGLib:
symbol='NUM_TP_LOCAL_HOLD_STATES': Unknown namespace for symbol
'NUM_TP_LOCAL_HOLD_STATES'
_gen/telepathy-enums.h:365: Warning: TelepathyGLib:
symbol='NUM_TP_LOCAL_HOLD_STATE_REASONS': Unknown namespace for symbol
'NUM_TP_LOCAL_HOLD_STATE_REASONS'
_gen/telepathy-enums.h:387: Warning: TelepathyGLib:
symbol='NUM_TP_DELIVERY_STATUSES': Unknown namespace for symbol
'NUM_TP_DELIVERY_STATUSES'
_gen/telepathy-enums.h:404: Warning: TelepathyGLib:
symbol='NUM_TP_SASL_ABORT_REASONS': Unknown namespace for symbol
'NUM_TP_SASL_ABORT_REASONS'
_gen/telepathy-enums.h:415: Warning: TelepathyGLib:
symbol='NUM_TP_SASL_STATUSES': Unknown namespace for symbol
'NUM_TP_SASL_STATUSES'
_gen/telepathy-enums.h:423: Warning: TelepathyGLib:
symbol='NUM_TP_TUBE_CHANNEL_STATES': Unknown namespace for symbol
'NUM_TP_TUBE_CHANNEL_STATES'
_gen/telepathy-enums.h:431: Warning: TelepathyGLib:
symbol='NUM_TP_SOCKET_ADDRESS_TYPES': Unknown namespace for symbol
'NUM_TP_SOCKET_ADDRESS_TYPES'
_gen/telepathy-enums.h:439: Warning: TelepathyGLib:
symbol='NUM_TP_SOCKET_ACCESS_CONTROLS': Unknown namespace for symbol
'NUM_TP_SOCKET_ACCESS_CONTROLS'
_gen/telepathy-enums.h:451: Warning: TelepathyGLib:
symbol='NUM_TP_MEDIA_STREAM_ERRORS': Unknown namespace for symbol
'NUM_TP_MEDIA_STREAM_ERRORS'
_gen/telepathy-enums.h:457: Warning: TelepathyGLib:
symbol='NUM_TP_MEDIA_STREAM_BASE_PROTOS': Unknown namespace for symbol
'NUM_TP_MEDIA_STREAM_BASE_PROTOS'
_gen/telepathy-enums.h:464: Warning: TelepathyGLib:
symbol='NUM_TP_MEDIA_STREAM_TRANSPORT_TYPES': Unknown namespace for symbol
'NUM_TP_MEDIA_STREAM_TRANSPORT_TYPES'
_gen/telepathy-enums.h:486: Warning: TelepathyGLib:
symbol='NUM_TP_DEBUG_LEVELS': Unknown namespace for symbol
'NUM_TP_DEBUG_LEVELS'
_gen/telepathy-enums.h:493: Warning: TelepathyGLib:
symbol='NUM_TP_TLS_CERTIFICATE_STATES': Unknown namespace for symbol
'NUM_TP_TLS_CERTIFICATE_STATES'
_gen/telepathy-interfaces.h:507: Warning: TelepathyGLib:
symbol='NUM_TP_TLS_CERTIFICATE_REJECT_REASONS': Unknown namespace for symbol
'NUM_TP_TLS_CERTIFICATE_REJECT_REASONS'

I also get the following about my unused types:

make  check-local
make[3]: Entering directory `/home/alsuren/src/telepathy-glib/docs/reference'
0 symbols incomplete.
0 not documented.
TP_TYPE_ACCESS_CONTROL_TYPE
TP_TYPE_ANONYMITY_MODE_FLAGS
TP_TYPE_CHANNEL_CALL_STATE_FLAGS
TP_TYPE_CHANNEL_CHAT_STATE
TP_TYPE_CHANNEL_CONTACT_SEARCH_STATE
TP_TYPE_CHANNEL_GROUP_CHANGE_REASON
TP_TYPE_CHANNEL_GROUP_FLAGS
TP_TYPE_CHANNEL_MEDIA_CAPABILITIES
TP_TYPE_CHANNEL_PASSWORD_FLAGS
TP_TYPE_CHANNEL_TEXT_MESSAGE_FLAGS
TP_TYPE_CHANNEL_TEXT_MESSAGE_TYPE
TP_TYPE_CHANNEL_TEXT_SEND_ERROR
TP_TYPE_CONNECTION_ALIAS_FLAGS
TP_TYPE_CONNECTION_CAPABILITY_FLAGS
TP_TYPE_CONNECTION_PRESENCE_TYPE
TP_TYPE_CONNECTION_STATUS
TP_TYPE_CONNECTION_STATUS_REASON
TP_TYPE_CONN_MGR_PARAM_FLAGS
TP_TYPE_CONTACT_BLOCKING_CAPABILITIES
TP_TYPE_CONTACT_INFO_FIELD_FLAGS
TP_TYPE_CONTACT_INFO_FLAGS
TP_TYPE_CONTACT_LIST_STATE
TP_TYPE_CONTACT_METADATA_STORAGE_TYPE
TP_TYPE_DEBUG_LEVEL
TP_TYPE_DELIVERY_REPORTING_SUPPORT_FLAGS
TP_TYPE_DELIVERY_STATUS
TP_TYPE_DTMF_EVENT
TP_TYPE_FILE_HASH_TYPE
TP_TYPE_FILE_TRANSFER_STATE
TP_TYPE_FILE_TRANSFER_STATE_CHANGE_REASON
TP_TYPE_HANDLE_TYPE
TP_TYPE_HTTP_METHOD
TP_TYPE_LOCAL_HOLD_STATE
TP_TYPE_LOCAL_HOLD_STATE_REASON
TP_TYPE_LOCATION_FEATURES
TP_TYPE_MAIL_NOTIFICATION_FLAGS
TP_TYPE_MEDIA_STREAM_BASE_PROTO
TP_TYPE_MEDIA_STREAM_DIRECTION
TP_TYPE_MEDIA_STREAM_ERROR
TP_TYPE_MEDIA_STREAM_PENDING_SEND
TP_TYPE_MEDIA_STREAM_STATE
TP_TYPE_MEDIA_STREAM_TRANSPORT_TYPE
TP_TYPE_MEDIA_STREAM_TYPE
TP_TYPE_MESSAGE_PART_SUPPORT_FLAGS
TP_TYPE_MESSAGE_SENDING_FLAGS
TP_TYPE_PROPERTY_FLAGS
TP_TYPE_RICH_PRESENCE_ACCESS_CONTROL_TYPE
TP_TYPE_SASL_ABORT_REASON
TP_TYPE_SASL_STATUS
TP_TYPE_SERVICE_POINT_TYPE
TP_TYPE_SOCKET_ACCESS_CONTROL
TP_TYPE_SOCKET_ADDRESS_TYPE
TP_TYPE_STORAGE_RESTRICTION_FLAGS
TP_TYPE_SUBSCRIPTION_STATE
TP_TYPE_TLS_CERTIFICATE_REJECT_REASON
TP_TYPE_TLS_CERTIFICATE_STATE
TP_TYPE_TUBE_CHANNEL_STATE
TP_TYPE_TUBE_STATE
TP_TYPE_TUBE_TYPE
tp_access_control_type_get_type
tp_anonymity_mode_flags_get_type
tp_channel_call_state_flags_get_type
tp_channel_chat_state_get_type
tp_channel_contact_search_state_get_type
tp_channel_group_change_reason_get_type
tp_channel_group_flags_get_type
tp_channel_media_capabilities_get_type
tp_channel_password_flags_get_type
tp_channel_text_message_flags_get_type
tp_channel_text_message_type_get_type
tp_channel_text_send_error_get_type
tp_conn_mgr_param_flags_get_type
tp_connection_alias_flags_get_type
tp_connection_capability_flags_get_type
tp_connection_presence_type_get_type
tp_connection_status_get_type
tp_connection_status_reason_get_type
tp_contact_blocking_capabilities_get_type
tp_contact_info_field_flags_get_type
tp_contact_info_flags_get_type
tp_contact_list_state_get_type
tp_contact_metadata_storage_type_get_type
tp_debug_level_get_type
tp_delivery_reporting_support_flags_get_type
tp_delivery_status_get_type
tp_dtmf_event_get_type
tp_file_hash_type_get_type
tp_file_transfer_state_change_reason_get_type
tp_file_transfer_state_get_type
tp_handle_type_get_type
tp_http_method_get_type
tp_local_hold_state_get_type
tp_local_hold_state_reason_get_type
tp_location_features_get_type
tp_mail_notification_flags_get_type
tp_media_stream_base_proto_get_type
tp_media_stream_direction_get_type
tp_media_stream_error_get_type
tp_media_stream_pending_send_get_type
tp_media_stream_state_get_type
tp_media_stream_transport_type_get_type
tp_media_stream_type_get_type
tp_message_part_support_flags_get_type
tp_message_sending_flags_get_type
tp_property_flags_get_type
tp_rich_presence_access_control_type_get_type
tp_sasl_abort_reason_get_type
tp_sasl_status_get_type
tp_service_point_type_get_type
tp_socket_access_control_get_type
tp_socket_address_type_get_type
tp_storage_restriction_flags_get_type
tp_subscription_state_get_type
tp_tls_certificate_reject_reason_get_type
tp_tls_certificate_state_get_type
tp_tube_channel_state_get_type
tp_tube_state_get_type
tp_tube_type_get_type
^^^ Unused symbols
Documentation check failed
make[3]: *** [check-local] Error 1

Do I need to add these to a .abi file somewhere? (note that I currently only
use TP_TYPE_CONNECTION_STATUS, TP_TYPE_CONNECTION_STATUS_REASON and
TP_TYPE_HANDLE_TYPE)

-- 
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