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 <aleksander@lanedo.com> 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.
This commit is contained in:
10
src/mm-log.c
10
src/mm-log.c
@@ -27,6 +27,10 @@
|
||||
#include <ModemManager.h>
|
||||
#include <mm-errors-types.h>
|
||||
|
||||
#if defined WITH_QMI
|
||||
#include <libqmi-glib.h>
|
||||
#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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user