From f1bcc531a353287d8f2b213b3bb8c33ceb13b724 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 9 Oct 2012 16:28:46 +0200 Subject: log: enable QMI traces when showing debug logs Use the new `qmi_utils_set_traces_enabled()' to specify that we want QMI traces when running with DEBUG logs. Sync with libqmi: commit 35dcb4bb6ed2755d968cf97d69faff9ed5f6871f Author: Aleksander Morgado Date: Tue Oct 9 13:44:16 2012 +0200 libqmi-glib: message traces compiled always Message traces have been very useful when debugging issues in the protocol, and we should avoid requiring a full recompilation in order to get them enabled. Instead, we provide two new API methods, `qmi_utils_(get|set)_traces_enabled()', which allow specifying whether traces should be dumped with g_debug() or not. --- src/mm-log.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mm-log.c') diff --git a/src/mm-log.c b/src/mm-log.c index 66f94c95..452e2e0e 100644 --- a/src/mm-log.c +++ b/src/mm-log.c @@ -27,6 +27,10 @@ #include #include +#if defined WITH_QMI +#include +#endif + #include "mm-log.h" enum { @@ -179,9 +183,15 @@ mm_log_set_level (const char *level, GError **error) break; } } + if (!found) g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Unknown log level '%s'", level); + +#if defined WITH_QMI + qmi_utils_set_traces_enabled (log_level & LOGL_DEBUG ? TRUE : FALSE); +#endif + return found; } -- cgit v1.2.3-70-g09d2