core: rework logging
Make it more flexible, add logging to a file, and absolute and relative timestamps.
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "mm-modem-helpers.h"
|
||||
#include "mm-log.h"
|
||||
|
||||
typedef struct {
|
||||
GPtrArray *solicited_creg;
|
||||
@@ -1079,8 +1080,7 @@ test_devid_item (void *f, gpointer d)
|
||||
item->gsn,
|
||||
item->revision,
|
||||
item->model,
|
||||
item->manf,
|
||||
FALSE);
|
||||
item->manf);
|
||||
g_assert (devid);
|
||||
if (strcmp (devid, item->devid))
|
||||
g_message ("%s", devid);
|
||||
@@ -1178,6 +1178,15 @@ test_data_free (TestData *data)
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
void
|
||||
_mm_log (const char *loc,
|
||||
const char *func,
|
||||
guint32 level,
|
||||
const char *fmt,
|
||||
...)
|
||||
{
|
||||
/* Dummy log function */
|
||||
}
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,25,12)
|
||||
typedef GTestFixtureFunc TCFunc;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "libqcdm/src/commands.h"
|
||||
#include "libqcdm/src/utils.h"
|
||||
#include "libqcdm/src/com.h"
|
||||
#include "mm-log.h"
|
||||
|
||||
typedef struct {
|
||||
int master;
|
||||
@@ -449,10 +450,14 @@ typedef void (*TCFunc)(void);
|
||||
#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL)
|
||||
#define TESTCASE_PTY(t, d) g_test_create_case (#t, sizeof (*d), d, (TCFunc) test_pty_create, (TCFunc) t, (TCFunc) test_pty_cleanup)
|
||||
|
||||
gboolean mm_options_debug (void);
|
||||
gboolean mm_options_debug (void)
|
||||
void
|
||||
_mm_log (const char *loc,
|
||||
const char *func,
|
||||
guint32 level,
|
||||
const char *fmt,
|
||||
...)
|
||||
{
|
||||
return g_test_verbose ();
|
||||
/* Dummy log function */
|
||||
}
|
||||
|
||||
int main (int argc, char **argv)
|
||||
|
Reference in New Issue
Block a user