summaryrefslogtreecommitdiff
path: root/src/nm-logging.h
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-10-14 15:32:56 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-10-14 15:57:43 +0200
commit92a8cfac69d8ac00df94dc4da7a09d8f168d0c46 (patch)
tree9fd68f9d2662c61493dbd86b8554d6c6b7b1bf9c /src/nm-logging.h
parentf551c91d3355184ba810f5ea63df79e3cefb678b (diff)
downloadNetworkManager-92a8cfac69d8ac00df94dc4da7a09d8f168d0c46.tar.gz
core: introduce default logging macros
Diffstat (limited to 'src/nm-logging.h')
-rw-r--r--src/nm-logging.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nm-logging.h b/src/nm-logging.h
index 59f2ad2b05..2c1a1059a3 100644
--- a/src/nm-logging.h
+++ b/src/nm-logging.h
@@ -275,4 +275,21 @@ extern void (*_nm_logging_clear_platform_logging_cache) (void);
/*****************************************************************************/
+#define __NMLOG_DEFAULT(level, domain, prefix, ...) \
+ G_STMT_START { \
+ nm_log ((level), (domain), \
+ "%s: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ (prefix) \
+ _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } G_STMT_END
+
+#define __NMLOG_DEFAULT_WITH_ADDR(level, domain, prefix, ...) \
+ G_STMT_START { \
+ nm_log ((level), (domain), \
+ "%s[%p]: " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
+ (prefix), \
+ (self) \
+ _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
+ } G_STMT_END
+
#endif /* __NETWORKMANAGER_LOGGING_H__ */