log: force using the object logging API

Unless the generic API is explicitly allowed, as in the main.c source
file.
This commit is contained in:
Aleksander Morgado
2020-04-09 07:34:39 +02:00
parent 956dc8a704
commit 6f82ea3732
2 changed files with 10 additions and 5 deletions

View File

@@ -26,8 +26,9 @@
#include "ModemManager.h" #include "ModemManager.h"
#include "mm-base-manager.h" #define MM_LOG_NO_OBJECT
#include "mm-log.h" #include "mm-log.h"
#include "mm-base-manager.h"
#include "mm-context.h" #include "mm-context.h"
#if defined WITH_SYSTEMD_SUSPEND_RESUME #if defined WITH_SYSTEMD_SUSPEND_RESUME

View File

@@ -36,10 +36,14 @@ typedef enum {
#define mm_obj_info(obj, ...) _mm_log (obj, MM_MODULE_NAME, G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_INFO, ## __VA_ARGS__ ) #define mm_obj_info(obj, ...) _mm_log (obj, MM_MODULE_NAME, G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_INFO, ## __VA_ARGS__ )
#define mm_obj_dbg(obj, ...) _mm_log (obj, MM_MODULE_NAME, G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_DEBUG, ## __VA_ARGS__ ) #define mm_obj_dbg(obj, ...) _mm_log (obj, MM_MODULE_NAME, G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_DEBUG, ## __VA_ARGS__ )
#define mm_err(...) mm_obj_err (NULL, ## __VA_ARGS__ ) /* only allow using non-object logging API if explicitly requested
#define mm_warn(...) mm_obj_warn (NULL, ## __VA_ARGS__ ) * (e.g. in the main daemon source) */
#define mm_info(...) mm_obj_info (NULL, ## __VA_ARGS__ ) #if defined MM_LOG_NO_OBJECT
#define mm_dbg(...) mm_obj_dbg (NULL, ## __VA_ARGS__ ) # define mm_err(...) mm_obj_err (NULL, ## __VA_ARGS__ )
# define mm_warn(...) mm_obj_warn (NULL, ## __VA_ARGS__ )
# define mm_info(...) mm_obj_info (NULL, ## __VA_ARGS__ )
# define mm_dbg(...) mm_obj_dbg (NULL, ## __VA_ARGS__ )
#endif
void _mm_log (gpointer obj, void _mm_log (gpointer obj,
const gchar *module, const gchar *module,