summaryrefslogtreecommitdiff
path: root/gobex
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2012-08-06 17:27:20 +0300
committerMarcel Holtmann <marcel@holtmann.org>2012-12-04 22:22:06 +0100
commit4621a3573c9cb862a04545486d3c2f09dd81a001 (patch)
tree5752385bae0c8c03451dd4ad7d60ba0db31cd71b /gobex
parenta3bb0a6dc549c898698c91d5991c4199315af51c (diff)
downloadbluez-4621a3573c9cb862a04545486d3c2f09dd81a001.tar.gz
gobex: Fix not printing debug messages when GOBEX_DEBUG is set
g_debug doesn't print anything if domain is not present in G_MESSAGES_DEBUG.
Diffstat (limited to 'gobex')
-rw-r--r--gobex/gobex-debug.h4
-rw-r--r--gobex/gobex.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/gobex/gobex-debug.h b/gobex/gobex-debug.h
index 589104e13..14faa1087 100644
--- a/gobex/gobex-debug.h
+++ b/gobex/gobex-debug.h
@@ -37,8 +37,8 @@ extern guint gobex_debug;
#define g_obex_debug(level, format, ...) \
if (gobex_debug & level) \
- g_debug("%s:%s() " format, __FILE__, __FUNCTION__, \
- ## __VA_ARGS__)
+ g_log("gobex", G_LOG_LEVEL_DEBUG, "%s:%s() " format, __FILE__, \
+ __FUNCTION__, ## __VA_ARGS__)
static inline void g_obex_dump(const char *prefix, const void *buf,
gsize len)
diff --git a/gobex/gobex.c b/gobex/gobex.c
index b20542df5..b6126b8d4 100644
--- a/gobex/gobex.c
+++ b/gobex/gobex.c
@@ -1246,9 +1246,11 @@ GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type,
if (gobex_debug == 0) {
const char *env = g_getenv("GOBEX_DEBUG");
- if (env)
+
+ if (env) {
gobex_debug = g_parse_debug_string(env, keys, 6);
- else
+ g_setenv("G_MESSAGES_DEBUG", "gobex", FALSE);
+ } else
gobex_debug = G_OBEX_DEBUG_NONE;
}