summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2010-02-11 18:17:29 +1100
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2010-02-12 21:45:32 +1100
commit78bd3ccb4b48555cfd45af02e424b9544b5cc68d (patch)
tree9df6753129e510106cc6dd7f71842e9a6e2dd2ff
parenta069bd9707e689724e5a1937d78045d6e5269537 (diff)
Replace uses of g_debug with DEBUG
-rw-r--r--src/telepathy-logger.c12
-rw-r--r--telepathy-logger/channel-factory.c5
-rw-r--r--telepathy-logger/channel-text.c12
-rw-r--r--telepathy-logger/channel.c7
-rw-r--r--telepathy-logger/conf.c6
-rw-r--r--telepathy-logger/dbus-service.c5
-rw-r--r--telepathy-logger/debug.c2
-rw-r--r--telepathy-logger/debug.h3
-rw-r--r--telepathy-logger/log-entry-text.c5
-rw-r--r--telepathy-logger/log-manager.c9
-rw-r--r--telepathy-logger/log-store-empathy.c2
-rw-r--r--telepathy-logger/log-store-factory.c5
12 files changed, 46 insertions, 27 deletions
diff --git a/src/telepathy-logger.c b/src/telepathy-logger.c
index 8a6f76fe7..ef5a895dd 100644
--- a/src/telepathy-logger.c
+++ b/src/telepathy-logger.c
@@ -104,12 +104,12 @@ telepathy_logger_dbus_init (void)
if (tp_dbus_daemon_request_name (tp_bus, TPL_DBUS_SRV_WELL_KNOWN_BUS_NAME,
TRUE, &error))
{
- g_debug ("%s DBus well known name registered",
+ DEBUG ("%s DBus well known name registered",
TPL_DBUS_SRV_WELL_KNOWN_BUS_NAME);
}
else
{
- g_debug ("Well Known name request error: %s", error->message);
+ DEBUG ("Well Known name request error: %s", error->message);
g_error_free (error);
}
@@ -141,18 +141,18 @@ main (int argc,
tpl_channel_factory_init ();
- g_debug ("Initialising TPL Channel Factory");
+ DEBUG ("Initialising TPL Channel Factory");
tpl_channel_factory_add ("org.freedesktop.Telepathy.Channel.Type.Text",
(TplChannelConstructor) tpl_channel_text_new);
- g_debug ("- TplChannelText registred.");
+ DEBUG ("- TplChannelText registred.");
observer = tpl_observer_new ();
- g_debug ("Registering channel factory into TplObserver");
+ DEBUG ("Registering channel factory into TplObserver");
tpl_observer_set_channel_factory (observer, tpl_channel_factory_build);
if (!tpl_observer_register_dbus (observer, &error))
{
- g_debug ("Error during D-Bus registration: %s", error->message);
+ DEBUG ("Error during D-Bus registration: %s", error->message);
return 1;
}
diff --git a/telepathy-logger/channel-factory.c b/telepathy-logger/channel-factory.c
index 13bbccdb5..f91c2009f 100644
--- a/telepathy-logger/channel-factory.c
+++ b/telepathy-logger/channel-factory.c
@@ -25,6 +25,9 @@
#include <telepathy-logger/channel-text.h>
+#define DEBUG_FLAG TPL_DEBUG_CHANNEL
+#include <telepathy-logger/debug.h>
+
static GHashTable *channel_table = NULL;
void
@@ -92,7 +95,7 @@ tpl_channel_factory_build (const gchar *channel_type,
chan_constructor = tpl_channel_factory_lookup (channel_type);
if (chan_constructor == NULL)
{
- g_debug ("%s: channel type not handled by this logger", channel_type);
+ DEBUG ("%s: channel type not handled by this logger", channel_type);
return NULL;
}
diff --git a/telepathy-logger/channel-text.c b/telepathy-logger/channel-text.c
index 3d2390315..d8de7edd3 100644
--- a/telepathy-logger/channel-text.c
+++ b/telepathy-logger/channel-text.c
@@ -25,8 +25,6 @@
* signals.
*/
-#define DEBUG_FLAG TPL_DEBUG_CHANNEL
-
#include "../config.h"
#include "channel-text.h"
@@ -835,7 +833,7 @@ on_received_signal_with_contact_cb (TpConnection *connection,
{
CHAN_DEBUG (tpl_text, "Unrecoverable error retrieving remote contact "
"information: %s", error->message);
- g_debug ("Not able to log the received message: %s",
+ DEBUG ("Not able to log the received message: %s",
tpl_log_entry_text_get_message (log));
g_object_unref (log);
return;
@@ -843,9 +841,9 @@ on_received_signal_with_contact_cb (TpConnection *connection,
if (n_failed > 0)
{
- g_debug ("%d invalid handle(s) passed to "
+ DEBUG ("%d invalid handle(s) passed to "
"tp_connection_get_contacts_by_handle()", n_failed);
- g_debug ("Not able to log the received message: %s",
+ DEBUG ("Not able to log the received message: %s",
tpl_log_entry_text_get_message (log));
g_object_unref (log);
return;
@@ -903,7 +901,7 @@ keepon (TplLogEntryText *log)
tpl_log_manager_add_message (logmanager, TPL_LOG_ENTRY (log), &e);
if (e != NULL)
{
- g_debug ("LogStore: %s", e->message);
+ DEBUG ("LogStore: %s", e->message);
g_error_free (e);
}
@@ -935,7 +933,7 @@ on_received_signal_cb (TpChannel *proxy,
notification and handle it correctly */
if (arg_Flags & TP_CHANNEL_TEXT_MESSAGE_FLAG_NON_TEXT_CONTENT)
{
- g_debug ("Non text content flag set. "
+ DEBUG ("Non text content flag set. "
"Probably a delivery notification for a sent message. "
"Ignoring");
return;
diff --git a/telepathy-logger/channel.c b/telepathy-logger/channel.c
index 0302314b9..5e38cc4ad 100644
--- a/telepathy-logger/channel.c
+++ b/telepathy-logger/channel.c
@@ -29,6 +29,9 @@
#include <telepathy-logger/channel-text.h>
+#define DEBUG_FLAG TPL_DEBUG_CHANNEL
+#include <telepathy-logger/debug.h>
+
#define TPCHAN_PROP_PREFIX "org.freedesktop.Telepathy.Channel."
#define TPCHAN_PROP_PREFIX_LEN strlen(TPCHAN_PROP_PREFIX)
@@ -250,7 +253,7 @@ got_ready_tp_connection_cb (TpConnection *connection,
if (error != NULL)
{
g_object_get (G_OBJECT (tpl_chan), "object-path", &chan_path, NULL);
- g_debug ("%s. Giving up channel '%s' observation", error->message,
+ DEBUG ("%s. Giving up channel '%s' observation", error->message,
chan_path);
g_free (chan_path);
@@ -288,7 +291,7 @@ got_ready_tp_channel_cb (TpChannel *channel,
g_object_get (channel, "connection", &tp_conn, NULL);
g_object_get (G_OBJECT (channel), "object-path", &chan_path, NULL);
- g_debug ("%s. Giving up channel '%s' observation", error->message,
+ DEBUG ("%s. Giving up channel '%s' observation", error->message,
chan_path);
g_free (chan_path);
diff --git a/telepathy-logger/conf.c b/telepathy-logger/conf.c
index 6a7bcc604..428642c09 100644
--- a/telepathy-logger/conf.c
+++ b/telepathy-logger/conf.c
@@ -25,7 +25,9 @@
#include <telepathy-logger/util.h>
-//#define DEBUG(...)
+#define DEBUG_FLAG TPL_DEBUG_CONF
+#include <telepathy-logger/debug.h>
+
#define GET_PRIV(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TPL_TYPE_CONF, TplConfPriv))
#define GCONF_KEY_LOGGING_TURNED_ON "/apps/telepathy-logger/logging/turned_on"
#define GCONF_KEY_LOGGING_ACCOUNTS_IGNORELIST "/apps/telepathy-logger/logging/accounts/ignorelist"
@@ -167,7 +169,7 @@ tpl_conf_is_globally_enabled (TplConf *self,
GCONF_KEY_LOGGING_TURNED_ON, &loc_error);
if (loc_error != NULL)
{
- g_debug ("Accessing " GCONF_KEY_LOGGING_TURNED_ON ": %s",
+ DEBUG ("Accessing " GCONF_KEY_LOGGING_TURNED_ON ": %s",
loc_error->message);
g_propagate_error (error, loc_error);
g_error_free (loc_error);
diff --git a/telepathy-logger/dbus-service.c b/telepathy-logger/dbus-service.c
index 97558ada5..e7db0213d 100644
--- a/telepathy-logger/dbus-service.c
+++ b/telepathy-logger/dbus-service.c
@@ -30,6 +30,9 @@
#include <extensions/extensions.h>
+#define DEBUG_FLAG TPL_DEBUG_DBUS_SERVICE
+#include <telepathy-logger/debug.h>
+
#define DBUS_STRUCT_STRING_STRING_UINT \
(dbus_g_type_get_struct ("GValueArray", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_INVALID))
@@ -104,7 +107,7 @@ _pack_last_chats_answer (GList *data,
g_ptr_array_add (retval, g_value_get_boxed (value));
g_free (value);
- g_debug ("retval[%d]=\"[%d] <%s>: %s\"\n", data_idx,
+ DEBUG ("retval[%d]=\"[%d] <%s>: %s\"\n", data_idx,
timestamp, sender, message);
}
return TRUE;
diff --git a/telepathy-logger/debug.c b/telepathy-logger/debug.c
index d9b4e055f..97cd0bb14 100644
--- a/telepathy-logger/debug.c
+++ b/telepathy-logger/debug.c
@@ -35,7 +35,9 @@ static GDebugKey keys[] = {
{ "log-manager", TPL_DEBUG_LOG_MANAGER },
{ "log-store", TPL_DEBUG_LOG_STORE },
{ "conf", TPL_DEBUG_CONF },
+ { "contact", TPL_DEBUG_CONTACT },
{ "main", TPL_DEBUG_MAIN },
+ { "dbus-service", TPL_DEBUG_DBUS_SERVICE },
{ 0, },
};
diff --git a/telepathy-logger/debug.h b/telepathy-logger/debug.h
index b7734aae1..030bfff11 100644
--- a/telepathy-logger/debug.h
+++ b/telepathy-logger/debug.h
@@ -38,7 +38,8 @@ typedef enum
TPL_DEBUG_LOG_STORE = 1 << 3,
TPL_DEBUG_CONF = 1 << 4,
TPL_DEBUG_CONTACT = 1 << 5,
- TPL_DEBUG_MAIN = 1 << 6
+ TPL_DEBUG_MAIN = 1 << 6,
+ TPL_DEBUG_DBUS_SERVICE = 1 << 7
} TplDebugFlags;
void tpl_debug_set_flags_from_env (void);
diff --git a/telepathy-logger/log-entry-text.c b/telepathy-logger/log-entry-text.c
index 39d24098e..24d838a67 100644
--- a/telepathy-logger/log-entry-text.c
+++ b/telepathy-logger/log-entry-text.c
@@ -27,6 +27,9 @@
#include <telepathy-logger/util.h>
#include <telepathy-logger/log-entry.h>
+#define DEBUG_FLAG TPL_DEBUG_LOG_STORE
+#include <telepathy-logger/debug.h>
+
G_DEFINE_TYPE (TplLogEntryText, tpl_log_entry_text, TPL_TYPE_LOG_ENTRY)
#define GET_PRIV(obj) TPL_GET_PRIV (obj, TplLogEntryText)
@@ -455,7 +458,7 @@ tpl_log_entry_text_equal (TplLogEntry *message1,
if (!tp_strdiff (priv1->entry.text->message, priv2->entry.text->message)) {
}
*/
- g_debug ("TODO: do a tpl_log_entry_equal rewrite!");
+ DEBUG ("TODO: do a tpl_log_entry_equal rewrite!");
return tpl_log_entry_text_get_log_id (TPL_LOG_ENTRY_TEXT (message1)) ==
tpl_log_entry_text_get_log_id ( TPL_LOG_ENTRY_TEXT (message2));
}
diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c
index ca4a566d0..5ac61e366 100644
--- a/telepathy-logger/log-manager.c
+++ b/telepathy-logger/log-manager.c
@@ -40,7 +40,8 @@
#include <telepathy-logger/datetime.h>
#include <telepathy-logger/util.h>
-#define DEBUG g_debug
+#define DEBUG_FLAG TPL_DEBUG_LOG_MANAGER
+#include <telepathy-logger/debug.h>
#define GET_PRIV(obj) TPL_GET_PRIV (obj, TplLogManager)
typedef struct
@@ -126,7 +127,7 @@ log_manager_constructor (GType type, guint n_props,
"writable", FALSE, "readable", TRUE, NULL);
if (tplogger == NULL)
{
- g_debug ("Error during TplLogStoreEmpathy (name=TpLogger) initialisation.");
+ DEBUG ("Error during TplLogStoreEmpathy (name=TpLogger) initialisation.");
return NULL;
}
@@ -162,11 +163,11 @@ tpl_log_manager_init (TplLogManager *manager)
*/
if (!g_thread_supported ())
{
- g_debug ("Initializing GThread");
+ DEBUG ("Initializing GThread");
g_thread_init (NULL);
}
else
- g_debug ("GThread already initialized. Brilliant!");
+ DEBUG ("GThread already initialized. Brilliant!");
}
diff --git a/telepathy-logger/log-store-empathy.c b/telepathy-logger/log-store-empathy.c
index 905024100..167c720c3 100644
--- a/telepathy-logger/log-store-empathy.c
+++ b/telepathy-logger/log-store-empathy.c
@@ -1175,7 +1175,7 @@ log_store_empathy_set_basedir (TplLogStore *self,
/* at install_spec time, default value is set to NULL, ignore it */
if (priv->basedir != NULL)
- g_debug ("logstore set to dir: %s", data);
+ DEBUG ("logstore set to dir: %s", data);
}
diff --git a/telepathy-logger/log-store-factory.c b/telepathy-logger/log-store-factory.c
index 8b54c4bef..05dd9e1ed 100644
--- a/telepathy-logger/log-store-factory.c
+++ b/telepathy-logger/log-store-factory.c
@@ -24,6 +24,9 @@
#include <telepathy-logger/util.h>
#include <telepathy-logger/log-store-empathy.h>
+#define DEBUG_FLAG TPL_DEBUG_LOG_STORE
+#include <telepathy-logger/debug.h>
+
static GHashTable *logstores_table = NULL;
void
@@ -90,7 +93,7 @@ tpl_log_store_factory_build (const gchar *logstore_type,
constructor = tpl_log_store_factory_lookup (logstore_type);
if (constructor == NULL)
{
- g_debug ("%s: log store type not handled by this logger", logstore_type);
+ DEBUG ("%s: log store type not handled by this logger", logstore_type);
return NULL;
}