Remove the broken concept of debug_enabled handling
diff --git a/src/log.c b/src/log.c
index ec996ba..ca2f6af 100644
--- a/src/log.c
+++ b/src/log.c
@@ -71,8 +71,6 @@
static gchar **enabled = NULL;
-int debug_enabled = FALSE;
-
static gboolean is_enabled(struct btd_debug_desc *desc)
{
int i;
@@ -94,7 +92,7 @@
void __btd_toggle_debug()
{
- debug_enabled = !debug_enabled;
+ /* FIXME: if not '*' already switch to full debug */
}
void __btd_log_init(const char *debug, int detach)
@@ -103,14 +101,8 @@
struct btd_debug_desc *desc;
const char *name = NULL, *file = NULL;
- if (debug != NULL) {
- debug_enabled = TRUE;
- } else {
- debug = g_strdup("*");
- debug_enabled = FALSE;
- }
-
- enabled = g_strsplit_set(debug, ":, ", 0);
+ if (debug != NULL)
+ enabled = g_strsplit_set(debug, ":, ", 0);
for (desc = __start___debug; desc < __stop___debug; desc++) {
if (file != NULL || name != NULL) {
diff --git a/src/log.h b/src/log.h
index 1706d2d..4e0e518 100644
--- a/src/log.h
+++ b/src/log.h
@@ -30,8 +30,6 @@
void __btd_log_cleanup(void);
void __btd_toggle_debug();
-extern int debug_enabled;
-
struct btd_debug_desc {
const char *name;
const char *file;
@@ -53,8 +51,7 @@
__attribute__((used, section("__debug"), aligned(8))) = { \
.file = __FILE__, .flags = BTD_DEBUG_FLAG_DEFAULT, \
}; \
- if (debug_enabled && \
- __btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
+ if (__btd_debug_desc.flags & BTD_DEBUG_FLAG_PRINT) \
btd_debug("%s:%s() " fmt, \
__FILE__, __FUNCTION__ , ## arg); \
} while (0)