diff options
author | Thomas Haller <thaller@redhat.com> | 2015-08-30 16:08:51 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-09-04 11:06:26 +0200 |
commit | 6bb26f86802d2c4fa2e2bfc582a16ad2db6bb496 (patch) | |
tree | 0bbc4749e6ea79ee93347f262a095c39a6f5f9d4 | |
parent | ed5ebf7e74eddeb2c98af5d707ed8b6fe114c335 (diff) | |
download | NetworkManager-6bb26f86802d2c4fa2e2bfc582a16ad2db6bb496.tar.gz |
platform: get rid of old logging macros
The naming of these logging macros is unexpected, as we use such
macros only here in platform.
For these messages we cannot use the default _LOGD() set of macros,
because there is no @platform instance around. So let's introduce an
alternative set of logging macros (_LOG2D(), etc) and use it.
-rw-r--r-- | src/platform/nm-linux-platform.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 9b2faa3737..6c17549426 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -66,9 +66,11 @@ /*********************************************************************************************/ -#define _NMLOG_DOMAIN LOGD_PLATFORM #define _NMLOG_PREFIX_NAME "platform-linux" -#define _NMLOG(level, ...) _LOG(level, _NMLOG_DOMAIN, platform, __VA_ARGS__) +#define _NMLOG_DOMAIN LOGD_PLATFORM +#define _NMLOG2_DOMAIN LOGD_PLATFORM +#define _NMLOG(level, ...) _LOG(level, _NMLOG_DOMAIN, platform, __VA_ARGS__) +#define _NMLOG2(level, ...) _LOG(level, _NMLOG2_DOMAIN, NULL, __VA_ARGS__) #define _LOG(level, domain, self, ...) \ G_STMT_START { \ @@ -90,12 +92,6 @@ } \ } G_STMT_END -#define trace(...) _LOG (LOGL_TRACE, _NMLOG_DOMAIN, NULL, __VA_ARGS__) -#define debug(...) _LOG (LOGL_DEBUG, _NMLOG_DOMAIN, NULL, __VA_ARGS__) -#define info(...) _LOG (LOGL_INFO, _NMLOG_DOMAIN, NULL, __VA_ARGS__) -#define warning(...) _LOG (LOGL_WARN , _NMLOG_DOMAIN, NULL, __VA_ARGS__) -#define error(...) _LOG (LOGL_ERR , _NMLOG_DOMAIN, NULL, __VA_ARGS__) - /****************************************************************** * Forward declarations and enums ******************************************************************/ @@ -167,7 +163,7 @@ _nl_get_vtable (void) if (!vtable.f_nl_has_capability) vtable.f_nl_has_capability = &_nl_f_nl_has_capability; - trace ("libnl: rtnl_link_get_link_netnsid() %s", vtable.f_rtnl_link_get_link_netnsid ? "supported" : "not supported"); + _LOG2t ("libnl: rtnl_link_get_link_netnsid() %s", vtable.f_rtnl_link_get_link_netnsid ? "supported" : "not supported"); g_return_val_if_fail (vtable.handle, &vtable); g_return_val_if_fail (vtable.handle_route, &vtable); @@ -529,7 +525,7 @@ _support_user_ipv6ll_get (void) #if HAVE_LIBNL_INET6_ADDR_GEN_MODE if (_support_user_ipv6ll_still_undecided ()) { _support_user_ipv6ll = -1; - nm_log_warn (LOGD_PLATFORM, "kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "failed to detect; assume no support"); + _LOG2W ("kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "failed to detect; assume no support"); } else return _support_user_ipv6ll > 0; #endif @@ -549,10 +545,10 @@ _support_user_ipv6ll_detect (const struct rtnl_link *rtnl_link) if (rtnl_link_inet6_get_addr_gen_mode ((struct rtnl_link *) rtnl_link, &mode) == 0) { _support_user_ipv6ll = 1; - nm_log_dbg (LOGD_PLATFORM, "kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "detected"); + _LOG2D ("kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "detected"); } else { _support_user_ipv6ll = -1; - nm_log_dbg (LOGD_PLATFORM, "kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "not detected"); + _LOG2D ("kernel support for IFLA_INET6_ADDR_GEN_MODE %s", "not detected"); } } #endif @@ -593,7 +589,7 @@ static gboolean _support_kernel_extended_ifa_flags_get (void) { if (_support_kernel_extended_ifa_flags_still_undecided ()) { - nm_log_warn (LOGD_PLATFORM, "Unable to detect kernel support for extended IFA_FLAGS. Assume no kernel support."); + _LOG2W ("Unable to detect kernel support for extended IFA_FLAGS. Assume no kernel support."); _support_kernel_extended_ifa_flags = -1; } return _support_kernel_extended_ifa_flags > 0; |