log: enable MBIM traces if running in debug mode

This commit is contained in:
Aleksander Morgado
2013-04-06 23:27:40 +02:00
parent cbee87f2f5
commit 12d6e59c86

View File

@@ -31,6 +31,10 @@
#include <libqmi-glib.h> #include <libqmi-glib.h>
#endif #endif
#if defined WITH_MBIM
#include <libmbim-glib.h>
#endif
#include "mm-log.h" #include "mm-log.h"
enum { enum {
@@ -192,6 +196,10 @@ mm_log_set_level (const char *level, GError **error)
qmi_utils_set_traces_enabled (log_level & LOGL_DEBUG ? TRUE : FALSE); qmi_utils_set_traces_enabled (log_level & LOGL_DEBUG ? TRUE : FALSE);
#endif #endif
#if defined WITH_MBIM
mbim_utils_set_traces_enabled (log_level & LOGL_DEBUG ? TRUE : FALSE);
#endif
return found; return found;
} }
@@ -243,6 +251,13 @@ mm_log_setup (const char *level,
NULL); NULL);
#endif #endif
#if defined WITH_MBIM
g_log_set_handler ("Mbim",
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
log_handler,
NULL);
#endif
return TRUE; return TRUE;
} }