diff options
| author | Michael Biebl <biebl@debian.org> | 2016-01-20 16:26:51 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-01-20 16:26:51 +0100 |
| commit | 494f296a3baab08522617b24b1f126d8f9a17502 (patch) | |
| tree | c8ef32fb0dd1c4ff35a0b38e787abb58692de0cd /src/nm-logging.h | |
| parent | 54f6333410ffd570e62717d9e77c5c987175e397 (diff) | |
Imported Upstream version 1.1.90 upstream/1.1.90
Diffstat (limited to 'src/nm-logging.h')
| -rw-r--r-- | src/nm-logging.h | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/src/nm-logging.h b/src/nm-logging.h index 077209f9..19b965f8 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -26,9 +26,9 @@ #error nm-test-utils.h must be included as last header #endif -#include <glib.h> -#include <glib-object.h> +#include "nm-logging.h" +#include "nm-default.h" #include "nm-macros-internal.h" /* Log domains */ @@ -57,18 +57,18 @@ typedef enum { /*< skip >*/ LOGD_CORE = (1LL << 20), /* Core daemon and policy stuff */ LOGD_DEVICE = (1LL << 21), /* Device state and activation */ LOGD_OLPC = (1LL << 22), - LOGD_WIMAX = (1LL << 23), - LOGD_INFINIBAND = (1LL << 24), - LOGD_FIREWALL = (1LL << 25), - LOGD_ADSL = (1LL << 26), - LOGD_BOND = (1LL << 27), - LOGD_VLAN = (1LL << 28), - LOGD_BRIDGE = (1LL << 29), - LOGD_DBUS_PROPS = (1LL << 30), - LOGD_TEAM = (1LL << 31), - LOGD_CONCHECK = (1LL << 32), - LOGD_DCB = (1LL << 33), /* Data Center Bridging */ - LOGD_DISPATCH = (1LL << 34), + LOGD_INFINIBAND = (1LL << 23), + LOGD_FIREWALL = (1LL << 24), + LOGD_ADSL = (1LL << 25), + LOGD_BOND = (1LL << 26), + LOGD_VLAN = (1LL << 27), + LOGD_BRIDGE = (1LL << 28), + LOGD_DBUS_PROPS = (1LL << 29), + LOGD_TEAM = (1LL << 30), + LOGD_CONCHECK = (1LL << 31), + LOGD_DCB = (1LL << 32), /* Data Center Bridging */ + LOGD_DISPATCH = (1LL << 33), + LOGD_AUDIT = (1LL << 34), __LOGD_MAX, LOGD_ALL = ((__LOGD_MAX - 1LL) << 1) - 1LL, @@ -91,7 +91,12 @@ typedef enum { /*< skip >*/ LOGL_WARN, LOGL_ERR, - LOGL_MAX + _LOGL_N_REAL, /* the number of actual logging levels */ + + _LOGL_OFF = _LOGL_N_REAL, /* special logging level that is always disabled. */ + _LOGL_KEEP, /* special logging level to indicate that the logging level should not be changed. */ + + _LOGL_N, /* the number of logging levels including "OFF" */ } NMLogLevel; #define nm_log_err(domain, ...) nm_log (LOGL_ERR, (domain), __VA_ARGS__) @@ -164,8 +169,7 @@ gboolean nm_logging_setup (const char *level, const char *domains, char **bad_domains, GError **error); -void nm_logging_syslog_openlog (gboolean debug); -void nm_logging_syslog_closelog (void); +void nm_logging_syslog_openlog (const char *logging_backend); /*****************************************************************************/ @@ -202,30 +206,30 @@ void nm_logging_syslog_closelog (void); * use. As with the _LOGD() macro familiy above, the exact implementation * depends on the file that uses them. * Still, it encourages a common pattern to have the common set of macros - * like _LOG2D(), _LOG2I(), etc. and have _LOG2t() which by default + * like _LOG2D(), _LOG2I(), etc. and have _LOG2T() which by default * is disabled at compile time. */ #define _NMLOG2_ENABLED(level) ( nm_logging_enabled ((level), (_NMLOG2_DOMAIN)) ) -#define _LOG2T(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) +#define _LOG2t(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) #define _LOG2D(...) _NMLOG2 (LOGL_DEBUG, __VA_ARGS__) #define _LOG2I(...) _NMLOG2 (LOGL_INFO , __VA_ARGS__) #define _LOG2W(...) _NMLOG2 (LOGL_WARN , __VA_ARGS__) #define _LOG2E(...) _NMLOG2 (LOGL_ERR , __VA_ARGS__) -#define _LOG2T_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) +#define _LOG2t_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) #define _LOG2D_ENABLED(...) _NMLOG2_ENABLED (LOGL_DEBUG, ##__VA_ARGS__) #define _LOG2I_ENABLED(...) _NMLOG2_ENABLED (LOGL_INFO , ##__VA_ARGS__) #define _LOG2W_ENABLED(...) _NMLOG2_ENABLED (LOGL_WARN , ##__VA_ARGS__) #define _LOG2E_ENABLED(...) _NMLOG2_ENABLED (LOGL_ERR , ##__VA_ARGS__) #ifdef NM_MORE_LOGGING -#define _LOG2t_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) -#define _LOG2t(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) +#define _LOG2T_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) +#define _LOG2T(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) #else /* still call the logging macros to get compile time checks, but they will be optimized out. */ -#define _LOG2t_ENABLED(...) ( FALSE && (_NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__)) ) -#define _LOG2t(...) G_STMT_START { if (FALSE) { _NMLOG2 (LOGL_TRACE, __VA_ARGS__); } } G_STMT_END +#define _LOG2T_ENABLED(...) ( FALSE && (_NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__)) ) +#define _LOG2T(...) G_STMT_START { if (FALSE) { _NMLOG2 (LOGL_TRACE, __VA_ARGS__); } } G_STMT_END #endif /*****************************************************************************/ |