logging: add new logging domain "SYSTEMD" for internal systemd logging
authorThomas Haller <thaller@redhat.com>
Fri, 11 Mar 2016 15:11:04 +0000 (16:11 +0100)
committerThomas Haller <thaller@redhat.com>
Thu, 17 Mar 2016 14:00:48 +0000 (15:00 +0100)
src/nm-logging.c
src/nm-logging.h
src/systemd/nm-sd-adapt.h

index 704c77c..935b34a 100644 (file)
@@ -111,7 +111,7 @@ static struct {
        char *logging_domains_to_string;
        const LogLevelDesc level_desc[_LOGL_N];
 
-#define _DOMAIN_DESC_LEN 36
+#define _DOMAIN_DESC_LEN 37
        /* Would be nice to use C99 flexible array member here,
         * but that feature doesn't seem well supported. */
        const LogDesc domain_desc[_DOMAIN_DESC_LEN];
@@ -164,6 +164,7 @@ static struct {
                { LOGD_DCB,       "DCB" },
                { LOGD_DISPATCH,  "DISPATCH" },
                { LOGD_AUDIT,     "AUDIT" },
+               { LOGD_SYSTEMD,   "SYSTEMD" },
                { 0, NULL }
                /* keep _DOMAIN_DESC_LEN in sync */
        },
index 41b5c16..27f89f5 100644 (file)
@@ -64,6 +64,7 @@ typedef enum  { /*< skip >*/
        LOGD_DCB        = (1LL << 32), /* Data Center Bridging */
        LOGD_DISPATCH   = (1LL << 33),
        LOGD_AUDIT      = (1LL << 34),
+       LOGD_SYSTEMD    = (1LL << 35),
 
        __LOGD_MAX,
        LOGD_ALL       = ((__LOGD_MAX - 1LL) << 1) - 1LL,
index 4fa0f5c..010c8a8 100644 (file)
@@ -53,7 +53,7 @@ _slog_level_to_nm (int slevel)
        const int _nm_e = (error); \
        const NMLogLevel _nm_l = _slog_level_to_nm ((level)); \
        \
-       if (nm_logging_enabled (_nm_l, LOGD_DHCP)) { \
+       if (nm_logging_enabled (_nm_l, LOGD_SYSTEMD)) { \
                const char *_nm_location = strrchr ((""file), '/'); \
                \
                _nm_log_impl (_nm_location ? _nm_location + 1 : (""file), (line), (func), _nm_l, LOGD_DHCP, _nm_e, ("%s"format), "libsystemd: ", ## __VA_ARGS__); \