log: common logging method definition for all testers and helpers

This commit is contained in:
Aleksander Morgado
2020-04-08 15:13:53 +02:00
parent f1e930d574
commit e956bac47b
29 changed files with 80 additions and 558 deletions

View File

@@ -23,7 +23,7 @@
#include <glib.h>
#include <gio/gio.h>
#include <mm-log.h>
#include <mm-log-test.h>
#include <mm-kernel-device-generic-rules.h>
#define PROGRAM_NAME "mmrules"
@@ -50,27 +50,6 @@ static GOptionEntry main_entries[] = {
{ NULL }
};
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
va_list args;
gchar *msg;
if (!verbose_flag)
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
}
static void
print_version_and_exit (void)
{

View File

@@ -26,7 +26,7 @@
#include <ModemManager.h>
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-sms-part-3gpp.h"
#define PROGRAM_NAME "mmsmspdu"
@@ -163,27 +163,6 @@ show_part_info (MMSmsPart *part)
}
}
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
va_list args;
gchar *msg;
if (!verbose_flag)
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
}
static void
print_version_and_exit (void)
{

View File

@@ -23,7 +23,7 @@
#include <glib.h>
#include <gio/gio.h>
#include <mm-log.h>
#include <mm-log-test.h>
#include <mm-port-serial.h>
#include <mm-port-serial-at.h>
#include <mm-serial-parsers.h>
@@ -83,27 +83,6 @@ signals_handler (int signum)
}
}
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
va_list args;
gchar *msg;
if (!verbose_flag)
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
}
static void
print_version_and_exit (void)
{