diff options
-rw-r--r-- | src/libnm-glib-aux/nm-logging-fwd.h | 2 | ||||
-rw-r--r-- | src/libnm-log-core/nm-logging.h | 26 | ||||
-rw-r--r-- | src/libnm-systemd-shared/src/basic/log.h | 2 |
3 files changed, 14 insertions, 16 deletions
diff --git a/src/libnm-glib-aux/nm-logging-fwd.h b/src/libnm-glib-aux/nm-logging-fwd.h index df0bb161e1..0ede91b2bc 100644 --- a/src/libnm-glib-aux/nm-logging-fwd.h +++ b/src/libnm-glib-aux/nm-logging-fwd.h @@ -93,6 +93,8 @@ void _nm_log_impl(const char *file, const char *fmt, ...) _nm_printf(10, 11); +#define _nm_log_full(...) _nm_log_impl(__VA_ARGS__) + static inline NMLogLevel nm_log_level_from_syslog(int syslog_level) { diff --git a/src/libnm-log-core/nm-logging.h b/src/libnm-log-core/nm-logging.h index 574c225c2e..8eecb7e41b 100644 --- a/src/libnm-log-core/nm-logging.h +++ b/src/libnm-log-core/nm-logging.h @@ -26,24 +26,20 @@ //#define _NM_LOG_FUNC G_STRFUNC #define _NM_LOG_FUNC NULL -/* A wrapper for the _nm_log_impl() function that adds call site information. +/* A wrapper for _nm_log_full() function that adds call site information. * Contrary to nm_log(), it unconditionally calls the function without * checking whether logging for the given level and domain is enabled. */ #define _nm_log_mt(mt_require_locking, level, domain, error, ifname, con_uuid, ...) \ - G_STMT_START \ - { \ - _nm_log_impl(__FILE__, \ - __LINE__, \ - _NM_LOG_FUNC, \ - (mt_require_locking), \ - (level), \ - (domain), \ - (error), \ - (ifname), \ - (con_uuid), \ - ""__VA_ARGS__); \ - } \ - G_STMT_END + _nm_log_full(__FILE__, \ + __LINE__, \ + _NM_LOG_FUNC, \ + (mt_require_locking), \ + (level), \ + (domain), \ + (error), \ + (ifname), \ + (con_uuid), \ + ""__VA_ARGS__) #define _nm_log(level, domain, error, ifname, con_uuid, ...) \ _nm_log_mt(!(NM_THREAD_SAFE_ON_MAIN_THREAD), \ diff --git a/src/libnm-systemd-shared/src/basic/log.h b/src/libnm-systemd-shared/src/basic/log.h index bcb3d494a1..0664977562 100644 --- a/src/libnm-systemd-shared/src/basic/log.h +++ b/src/libnm-systemd-shared/src/basic/log.h @@ -113,7 +113,7 @@ int log_internal( if (_nm_log_enabled_impl(!(NM_THREAD_SAFE_ON_MAIN_THREAD), _nm_l, LOGD_SYSTEMD)) { \ const char *_nm_location = strrchr(("" file), '/'); \ \ - _nm_log_impl(_nm_location ? _nm_location + 1 : ("" file), \ + _nm_log_full(_nm_location ? _nm_location + 1 : ("" file), \ (line), \ (func), \ !(NM_THREAD_SAFE_ON_MAIN_THREAD), \ |