From e152ec7bf4ba252ff9d3eb13eabd417b931dac9a Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Mon, 24 Sep 2018 09:29:55 +0100 Subject: Import Upstream version 1.12.2 --- src/nm-logging.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/nm-logging.h') diff --git a/src/nm-logging.h b/src/nm-logging.h index 8fcbc8cc..70c14a5e 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -28,6 +28,10 @@ #error nm-test-utils.h must be included as last header #endif +#define NM_LOG_CONFIG_BACKEND_DEBUG "debug" +#define NM_LOG_CONFIG_BACKEND_SYSLOG "syslog" +#define NM_LOG_CONFIG_BACKEND_JOURNAL "journal" + /* Log domains */ typedef enum { /*< skip >*/ LOGD_NONE = 0LL, @@ -83,6 +87,16 @@ typedef enum { /*< skip >*/ LOGD_IP = LOGD_IP4 | LOGD_IP6, } NMLogDomain; +static inline NMLogDomain +LOGD_IP_from_af (int addr_family) +{ + switch (addr_family) { + case AF_INET: return LOGD_IP4; + case AF_INET6: return LOGD_IP6; + } + g_return_val_if_reached (LOGD_NONE); +} + /* Log levels */ typedef enum { /*< skip >*/ LOGL_TRACE, @@ -123,7 +137,7 @@ typedef enum { /*< skip >*/ ""__VA_ARGS__); \ } G_STMT_END -/* nm_log() only evaluates it's argument list after checking +/* nm_log() only evaluates its argument list after checking * whether logging for the given level/domain is enabled. */ #define nm_log(level, domain, ifname, con_uuid, ...) \ G_STMT_START { \ @@ -132,7 +146,6 @@ typedef enum { /*< skip >*/ } \ } G_STMT_END - #define _nm_log_ptr(level, domain, ifname, con_uuid, self, prefix, ...) \ nm_log ((level), \ (domain), \ @@ -172,7 +185,6 @@ _nm_log_ptr_is_debug (NMLogLevel level) } \ } G_STMT_END - #define _nm_log_obj(level, domain, ifname, con_uuid, self, prefix, ...) \ _nm_log_ptr ((level), \ (domain), \ -- cgit 1.3.0-6-gf8a5