diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-10-31 17:33:26 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2013-10-31 17:35:33 +0000 |
commit | 5132ac05ba431d4ec2a71f8ffa5feb23df5fb5de (patch) | |
tree | 071b925568981d733072ca071ecef47137b881b7 | |
parent | 8254aee5423fd6e3afe0cf559edccea608666a99 (diff) |
Always enable compile-time debug messagesnext-merge-logger
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 7 | ||||
-rw-r--r-- | examples/cm/call/main.c | 2 | ||||
-rw-r--r-- | examples/cm/channelspecific/main.c | 2 | ||||
-rw-r--r-- | examples/cm/contactlist/main.c | 2 | ||||
-rw-r--r-- | examples/cm/echo-message-parts/main.c | 2 | ||||
-rw-r--r-- | examples/cm/extended/main.c | 2 | ||||
-rw-r--r-- | examples/cm/no-protocols/main.c | 2 | ||||
-rw-r--r-- | telepathy-glib/dbus-properties-mixin.c | 8 | ||||
-rw-r--r-- | telepathy-glib/debug-internal.h | 18 | ||||
-rw-r--r-- | telepathy-glib/debug.c | 4 | ||||
-rw-r--r-- | telepathy-glib/protocol.c | 4 | ||||
-rw-r--r-- | telepathy-logger/debug.c | 2 | ||||
-rw-r--r-- | telepathy-logger/telepathy-logger.c | 7 | ||||
-rw-r--r-- | tests/debug-domain.c | 9 | ||||
-rw-r--r-- | tests/internal-debug.c | 8 | ||||
-rw-r--r-- | tests/logger/dbus/test-log-manager.c | 4 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-iter-pidgin.c | 2 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-iter-xml.c | 2 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-store-pidgin.c | 4 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-store-xml.c | 2 | ||||
-rw-r--r-- | tests/logger/dbus/test-tpl-log-walker.c | 2 |
22 files changed, 2 insertions, 94 deletions
diff --git a/Makefile.am b/Makefile.am index d61417eef..14a0ffb3c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,7 +31,6 @@ SUBDIRS += docs DISTCHECK_CONFIGURE_FLAGS = \ --enable-gtk-doc \ - --disable-debug \ --disable-scrollkeeper \ --disable-schemas-install \ $(NULL) diff --git a/configure.ac b/configure.ac index 1afc1f902..ec4379e2b 100644 --- a/configure.ac +++ b/configure.ac @@ -191,10 +191,6 @@ AC_SUBST([ERROR_SCANNERFLAGS]) # use ${enable_fatal_warnings} instead. AM_CONDITIONAL([OFFICIAL_RELEASE], [test "x$official_release" = xyes]) -AC_ARG_ENABLE(debug, - AC_HELP_STRING([--disable-debug],[compile without debug code (note that this will disable much of the debug code in all GLib connection managers)]), - enable_debug=$enableval, enable_debug=yes ) - AC_ARG_ENABLE(debug-cache, AS_HELP_STRING([--enable-debug-cache], [compile with code to unconditionally cache all debug messages whether or not they are actually emitted]), @@ -208,9 +204,6 @@ AC_ARG_ENABLE(backtrace, AC_HELP_STRING([--enable-backtrace],[enable printing out the backtrace in case of crash (in most GLib connection managers)]), enable_backtrace=$enableval, enable_backtrace=no ) -AS_IF([test x$enable_debug = xyes], - [AC_DEFINE([ENABLE_DEBUG], [], [Enable debug code])]) - AS_IF([test x$enable_backtrace = xyes], [AC_DEFINE([ENABLE_BACKTRACE], [], [Enable backtrace output on crashes])]) diff --git a/examples/cm/call/main.c b/examples/cm/call/main.c index aee9f17bc..b96a5c606 100644 --- a/examples/cm/call/main.c +++ b/examples/cm/call/main.c @@ -39,7 +39,6 @@ int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); @@ -48,7 +47,6 @@ main (int argc, if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); -#endif /* strictly speaking, this is only necessary for client code, but it's * harmless here */ diff --git a/examples/cm/channelspecific/main.c b/examples/cm/channelspecific/main.c index 5ba4ac36a..bafd553ee 100644 --- a/examples/cm/channelspecific/main.c +++ b/examples/cm/channelspecific/main.c @@ -27,7 +27,6 @@ int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); @@ -36,7 +35,6 @@ main (int argc, if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); -#endif return tp_run_connection_manager ("telepathy-example-cm-csh", VERSION, construct_cm, argc, argv); diff --git a/examples/cm/contactlist/main.c b/examples/cm/contactlist/main.c index 222c7bb42..006c68b3d 100644 --- a/examples/cm/contactlist/main.c +++ b/examples/cm/contactlist/main.c @@ -27,7 +27,6 @@ int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); @@ -36,7 +35,6 @@ main (int argc, if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); -#endif return tp_run_connection_manager ("telepathy-example-cm-contactlist", VERSION, construct_cm, argc, argv); diff --git a/examples/cm/echo-message-parts/main.c b/examples/cm/echo-message-parts/main.c index e3941ccc7..8143c8566 100644 --- a/examples/cm/echo-message-parts/main.c +++ b/examples/cm/echo-message-parts/main.c @@ -26,7 +26,6 @@ int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); @@ -35,7 +34,6 @@ main (int argc, if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); -#endif return tp_run_connection_manager ("telepathy-example-cm-echo-2", VERSION, construct_cm, argc, argv); diff --git a/examples/cm/extended/main.c b/examples/cm/extended/main.c index a265ca3c8..b3c010ce4 100644 --- a/examples/cm/extended/main.c +++ b/examples/cm/extended/main.c @@ -27,7 +27,6 @@ int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); @@ -36,7 +35,6 @@ main (int argc, if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); -#endif return tp_run_connection_manager ("telepathy-example-cm-extended", VERSION, construct_cm, argc, argv); diff --git a/examples/cm/no-protocols/main.c b/examples/cm/no-protocols/main.c index a88ac7d71..63908a627 100644 --- a/examples/cm/no-protocols/main.c +++ b/examples/cm/no-protocols/main.c @@ -27,7 +27,6 @@ int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG tp_debug_divert_messages (g_getenv ("EXAMPLE_CM_LOGFILE")); tp_debug_set_flags (g_getenv ("EXAMPLE_DEBUG")); @@ -36,7 +35,6 @@ main (int argc, if (g_getenv ("EXAMPLE_PERSIST") != NULL) tp_debug_set_persistent (TRUE); -#endif return tp_run_connection_manager ("telepathy-example-no-protocols", VERSION, construct_cm, argc, argv); diff --git a/telepathy-glib/dbus-properties-mixin.c b/telepathy-glib/dbus-properties-mixin.c index ed9f9c06b..050e2d8e8 100644 --- a/telepathy-glib/dbus-properties-mixin.c +++ b/telepathy-glib/dbus-properties-mixin.c @@ -456,7 +456,6 @@ tp_dbus_properties_mixin_implement_interface (GObjectClass *cls, { TpDBusPropertiesMixinIfaceImpl *next = g_type_get_qdata (type, extras_quark); -#ifdef ENABLE_DEBUG GQuark offset_quark = _prop_mixin_offset_quark (); gpointer offset_qdata = g_type_get_qdata (type, offset_quark); TpDBusPropertiesMixinClass *mixin = NULL; @@ -505,16 +504,13 @@ tp_dbus_properties_mixin_implement_interface (GObjectClass *cls, } } } -#endif /* form a linked list */ iface_impl->mixin_next = next; g_type_set_qdata (type, extras_quark, iface_impl); } -#ifdef ENABLE_DEBUG out: -#endif g_free (interfaces); } @@ -581,15 +577,12 @@ tp_dbus_properties_mixin_class_init (GObjectClass *cls, iface_impl++) { GQuark iface_quark = g_quark_try_string (iface_impl->name); -#ifdef ENABLE_DEBUG TpDBusPropertiesMixinIfaceImpl *other_impl; -#endif if (G_UNLIKELY (!link_interface (type, interfaces, iface_quark, iface_impl))) goto out; -#ifdef ENABLE_DEBUG for (other_impl = mixin->interfaces; other_impl != iface_impl; other_impl++) @@ -603,7 +596,6 @@ tp_dbus_properties_mixin_class_init (GObjectClass *cls, goto out; } } -#endif } out: diff --git a/telepathy-glib/debug-internal.h b/telepathy-glib/debug-internal.h index 4f8c0fea7..7e756844d 100644 --- a/telepathy-glib/debug-internal.h +++ b/telepathy-glib/debug-internal.h @@ -101,23 +101,9 @@ G_END_DECLS #undef DEBUG #undef DEBUGGING -#ifdef ENABLE_DEBUG -# define DEBUG(format, ...) \ +#define DEBUG(format, ...) \ _tp_log (G_LOG_LEVEL_DEBUG, DEBUG_FLAG, "%s: " format, \ G_STRFUNC, ##__VA_ARGS__) -# define DEBUGGING _tp_debug_flag_is_set (DEBUG_FLAG) -#else /* !defined (ENABLE_DEBUG) */ -# ifndef DEBUG_STUB_DEFINED -static inline void -DEBUG ( - const gchar *format, - ...) -{ -} -# define DEBUG_STUB_DEFINED 1 -# endif // ifndef DEBUG_STUB_DEFINED - -# define DEBUGGING 0 -#endif /* !defined (ENABLE_DEBUG) */ +#define DEBUGGING _tp_debug_flag_is_set (DEBUG_FLAG) #endif /* defined (DEBUG_FLAG) */ diff --git a/telepathy-glib/debug.c b/telepathy-glib/debug.c index 36a673223..62099558f 100644 --- a/telepathy-glib/debug.c +++ b/telepathy-glib/debug.c @@ -370,7 +370,6 @@ tp_debug_timestamped_log_handler (const gchar *log_domain, const gchar *message, gpointer ignored) { -#ifdef ENABLE_DEBUG GTimeVal now; gchar *tmp, *now_str; @@ -379,11 +378,8 @@ tp_debug_timestamped_log_handler (const gchar *log_domain, tmp = g_strdup_printf ("%s: %s", now_str, message); g_free (now_str); message = tmp; -#endif g_log_default_handler (log_domain, log_level, message, NULL); -#ifdef ENABLE_DEBUG g_free (tmp); -#endif } diff --git a/telepathy-glib/protocol.c b/telepathy-glib/protocol.c index 3bec5c117..3d98b3830 100644 --- a/telepathy-glib/protocol.c +++ b/telepathy-glib/protocol.c @@ -217,7 +217,6 @@ tp_protocol_params_from_param_specs (const GPtrArray *parameters, param->flags |= TP_CONN_MGR_PARAM_FLAG_SECRET; } -#ifdef ENABLE_DEBUG { gchar *repr = g_strdup_value_contents (&(param->default_value)); @@ -225,7 +224,6 @@ tp_protocol_params_from_param_specs (const GPtrArray *parameters, G_VALUE_TYPE_NAME (&(param->default_value))); g_free (repr); } -#endif } return output; @@ -1595,7 +1593,6 @@ _tp_protocol_parse_manager_file (GKeyFile *file, DEBUG ("\tParam flags: 0x%x", param.flags); DEBUG ("\tParam sig: %s", param.dbus_signature); -#ifdef ENABLE_DEBUG if (G_IS_VALUE (¶m.default_value)) { gchar *repr = g_strdup_value_contents (&(param.default_value)); @@ -1608,7 +1605,6 @@ _tp_protocol_parse_manager_file (GKeyFile *file, { DEBUG ("\tParam default value: not set"); } -#endif g_ptr_array_add (param_specs, tp_value_array_build (4, G_TYPE_STRING, param.name, diff --git a/telepathy-logger/debug.c b/telepathy-logger/debug.c index e25b6ba78..cd59a1286 100644 --- a/telepathy-logger/debug.c +++ b/telepathy-logger/debug.c @@ -88,7 +88,6 @@ void _tpl_debug (TplDebugFlags flag, const gchar *format, ...) { -#ifdef ENABLE_DEBUG gchar *message; va_list args; @@ -100,7 +99,6 @@ void _tpl_debug (TplDebugFlags flag, g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s", message); g_free (message); -#endif } /* The following function has to be always define or CRITICAL messages won't diff --git a/telepathy-logger/telepathy-logger.c b/telepathy-logger/telepathy-logger.c index 9f63bdf90..cc0bc85e3 100644 --- a/telepathy-logger/telepathy-logger.c +++ b/telepathy-logger/telepathy-logger.c @@ -32,7 +32,6 @@ static GMainLoop *loop = NULL; -#ifdef ENABLE_DEBUG static TpDebugSender *debug_sender = NULL; static gboolean stamp_logs = FALSE; @@ -83,8 +82,6 @@ log_handler (const gchar *log_domain, log_to_debug_sender (log_domain, log_level, message); } -#endif /* ENABLE_DEBUG */ - static TplDBusService * telepathy_logger_dbus_init (void) @@ -141,14 +138,12 @@ main (int argc, tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); stamp_logs = (g_getenv ("TPL_TIMING") != NULL); debug_sender = tp_debug_sender_dup (); g_log_set_default_handler (log_handler, NULL); -#endif /* ENABLE_DEBUG */ observer = _tpl_observer_dup (&error); @@ -176,10 +171,8 @@ out: if (dbus_srv != NULL) g_object_unref (dbus_srv); -#ifdef ENABLE_DEBUG g_log_set_default_handler (g_log_default_handler, NULL); g_object_unref (debug_sender); -#endif /* ENABLE_DEBUG */ return 0; } diff --git a/tests/debug-domain.c b/tests/debug-domain.c index 37ef41804..d3ec89ddf 100644 --- a/tests/debug-domain.c +++ b/tests/debug-domain.c @@ -6,10 +6,6 @@ #include "telepathy-glib/debug-internal.h" -/* Only run test if ENABLE_DEBUG is defined, otherwise we won't have - * _tp_log and the TpDebugFlags enum. */ -#ifdef ENABLE_DEBUG - typedef struct { guint flag; @@ -47,11 +43,9 @@ handler (const gchar *log_domain, g_strfreev (parts); } -#endif int main (int argc, char **argv) { -#ifdef ENABLE_DEBUG TestItem i; g_type_init (); @@ -66,8 +60,5 @@ int main (int argc, char **argv) _tp_log (G_LOG_LEVEL_DEBUG, i.flag, "foo"); } -#else - g_print ("Not running test-debug-domain test as ENABLE_DEBUG is undefined\n"); -#endif return 0; } diff --git a/tests/internal-debug.c b/tests/internal-debug.c index 894924920..d0b3249a7 100644 --- a/tests/internal-debug.c +++ b/tests/internal-debug.c @@ -21,11 +21,7 @@ test_debugging (void) #error internal-debug.h should always define DEBUGGING #endif -#ifdef ENABLE_DEBUG g_assert (DEBUGGING == 1); -#else - g_assert (DEBUGGING == 0); -#endif } #undef DEBUG_FLAG @@ -59,11 +55,7 @@ test_debugging_again (void) #error internal-debug.h should always define DEBUGGING #endif -#ifdef ENABLE_DEBUG g_assert (DEBUGGING == 1); -#else - g_assert (DEBUGGING == 0); -#endif } int diff --git a/tests/logger/dbus/test-log-manager.c b/tests/logger/dbus/test-log-manager.c index 6bd7b66f9..c09dfd9ba 100644 --- a/tests/logger/dbus/test-log-manager.c +++ b/tests/logger/dbus/test-log-manager.c @@ -41,7 +41,6 @@ typedef struct -#ifdef ENABLE_DEBUG static TpDebugSender *debug_sender = NULL; static gboolean stamp_logs = FALSE; @@ -92,7 +91,6 @@ log_handler (const gchar *log_domain, log_to_debug_sender (log_domain, log_level, message); } -#endif /* ENABLE_DEBUG */ static void @@ -263,14 +261,12 @@ setup_debug (void) { tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); stamp_logs = (g_getenv ("TPL_TIMING") != NULL); debug_sender = tp_debug_sender_dup (); g_log_set_default_handler (log_handler, NULL); -#endif /* ENABLE_DEBUG */ } diff --git a/tests/logger/dbus/test-tpl-log-iter-pidgin.c b/tests/logger/dbus/test-tpl-log-iter-pidgin.c index 11e1b5e22..e90247a1e 100644 --- a/tests/logger/dbus/test-tpl-log-iter-pidgin.c +++ b/tests/logger/dbus/test-tpl-log-iter-pidgin.c @@ -112,9 +112,7 @@ setup (PidginTestCaseFixture* fixture, tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); -#endif /* ENABLE_DEBUG */ } diff --git a/tests/logger/dbus/test-tpl-log-iter-xml.c b/tests/logger/dbus/test-tpl-log-iter-xml.c index 9053f7d89..ae077f54d 100644 --- a/tests/logger/dbus/test-tpl-log-iter-xml.c +++ b/tests/logger/dbus/test-tpl-log-iter-xml.c @@ -58,9 +58,7 @@ setup (XmlTestCaseFixture* fixture, tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); -#endif /* ENABLE_DEBUG */ } diff --git a/tests/logger/dbus/test-tpl-log-store-pidgin.c b/tests/logger/dbus/test-tpl-log-store-pidgin.c index edd3ddb11..7c9dc2b61 100644 --- a/tests/logger/dbus/test-tpl-log-store-pidgin.c +++ b/tests/logger/dbus/test-tpl-log-store-pidgin.c @@ -43,7 +43,6 @@ typedef struct TplEntity *contact; } PidginTestCaseFixture; -#ifdef ENABLE_DEBUG static TpDebugSender *debug_sender = NULL; static gboolean stamp_logs = FALSE; @@ -94,7 +93,6 @@ log_handler (const gchar *log_domain, log_to_debug_sender (log_domain, log_level, message); } -#endif /* ENABLE_DEBUG */ static void @@ -513,14 +511,12 @@ setup_debug (void) { tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); stamp_logs = (g_getenv ("TPL_TIMING") != NULL); debug_sender = tp_debug_sender_dup (); g_log_set_default_handler (log_handler, NULL); -#endif /* ENABLE_DEBUG */ } diff --git a/tests/logger/dbus/test-tpl-log-store-xml.c b/tests/logger/dbus/test-tpl-log-store-xml.c index 22c6d9cb5..f8d7d95ac 100644 --- a/tests/logger/dbus/test-tpl-log-store-xml.c +++ b/tests/logger/dbus/test-tpl-log-store-xml.c @@ -57,9 +57,7 @@ setup (XmlTestCaseFixture* fixture, tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); -#endif /* ENABLE_DEBUG */ } diff --git a/tests/logger/dbus/test-tpl-log-walker.c b/tests/logger/dbus/test-tpl-log-walker.c index b924a1292..56a92f25a 100644 --- a/tests/logger/dbus/test-tpl-log-walker.c +++ b/tests/logger/dbus/test-tpl-log-walker.c @@ -112,9 +112,7 @@ setup (WalkerTestCaseFixture* fixture, tp_debug_divert_messages (g_getenv ("TPL_LOGFILE")); -#ifdef ENABLE_DEBUG _tpl_debug_set_flags_from_env (); -#endif /* ENABLE_DEBUG */ } |