diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-01-11 09:42:55 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-01-11 10:07:22 -0500 |
commit | 39032b87779323a244dd89f4832949d462b2ac68 (patch) | |
tree | b274a23bb72a04f72c322c6355b2c41cc6daa7ea /src/network/networkd.h | |
parent | ea18a4b57e2bb94af7b3ecb7abdaec40e9f485f0 (diff) |
network: use GNU-ism to simplify macros
Thanks David!
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r-- | src/network/networkd.h | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h index 2da852fea4..4f44f78655 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -281,37 +281,23 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_free); /* Macros which append INTERFACE= to the message */ -#define log_full_link(level, link, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", link->ifname, "%s: " fmt, link->ifname, __VA_ARGS__) -#define log_debug_link(link, ...) log_full_link(LOG_DEBUG, link, __VA_ARGS__) -#define log_info_link(link, ...) log_full_link(LOG_INFO, link, __VA_ARGS__) -#define log_notice_link(link, ...) log_full_link(LOG_NOTICE, link, __VA_ARGS__) -#define log_warning_link(link, ...) log_full_link(LOG_WARNING, link, __VA_ARGS__) -#define log_error_link(link, ...) log_full_link(LOG_ERR, link, __VA_ARGS__) - -#define log_link_full(level, link, message) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", link->ifname, "%s: " message, link->ifname) -#define log_link_debug(link, ...) log_link_full(LOG_DEBUG, link, __VA_ARGS__) -#define log_link_info(link, ...) log_link_full(LOG_INFO, link, __VA_ARGS__) -#define log_link_notice(link, ...) log_link_full(LOG_NOTICE, link, __VA_ARGS__) -#define log_link_warning(link, ...) log_link_full(LOG_WARNING, link, __VA_ARGS__) -#define log_link_error(link, ...) log_link_full(LOG_ERR, link, __VA_ARGS__) +#define log_full_link(level, link, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", link->ifname, "%s: " fmt, link->ifname, ##__VA_ARGS__) +#define log_debug_link(link, ...) log_full_link(LOG_DEBUG, link, ##__VA_ARGS__) +#define log_info_link(link, ...) log_full_link(LOG_INFO, link, ##__VA_ARGS__) +#define log_notice_link(link, ...) log_full_link(LOG_NOTICE, link, ##__VA_ARGS__) +#define log_warning_link(link, ...) log_full_link(LOG_WARNING, link, ##__VA_ARGS__) +#define log_error_link(link, ...) log_full_link(LOG_ERR, link, ##__VA_ARGS__) #define log_struct_link(level, link, ...) log_struct(level, "INTERFACE=%s", link->ifname, __VA_ARGS__) /* More macros which append INTERFACE= to the message */ -#define log_full_bridge(level, bridge, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", bridge->name, "%s: " fmt, bridge->name, __VA_ARGS__) -#define log_debug_bridge(bridge, ...) log_full_bridge(LOG_DEBUG, bridge, __VA_ARGS__) -#define log_info_bridge(bridge, ...) log_full_bridge(LOG_INFO, bridge, __VA_ARGS__) -#define log_notice_bridge(bridge, ...) log_full_bridge(LOG_NOTICE, bridge, __VA_ARGS__) -#define log_warning_bridge(bridge, ...) log_full_bridge(LOG_WARNING, bridge, __VA_ARGS__) -#define log_error_bridge(bridge, ...) log_full_bridge(LOG_ERR, bridge, __VA_ARGS__) - -#define log_bridge_full(level, bridge, message) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", bridge->name, "%s: " message, bridge->name) -#define log_bridge_debug(bridge, ...) log_bridge_full(LOG_DEBUG, bridge, __VA_ARGS__) -#define log_bridge_info(bridge, ...) log_bridge_full(LOG_INFO, bridge, __VA_ARGS__) -#define log_bridge_notice(bridge, ...) log_bridge_full(LOG_NOTICE, bridge, __VA_ARGS__) -#define log_bridge_warning(bridge, ...) log_bridge_full(LOG_WARNING, bridge, __VA_ARGS__) -#define log_bridge_error(bridge, ...) log_bridge_full(LOG_ERR, bridge, __VA_ARGS__) +#define log_full_bridge(level, bridge, fmt, ...) log_meta_object(level, __FILE__, __LINE__, __func__, "INTERFACE=", bridge->name, "%s: " fmt, bridge->name, ##__VA_ARGS__) +#define log_debug_bridge(bridge, ...) log_full_bridge(LOG_DEBUG, bridge, ##__VA_ARGS__) +#define log_info_bridge(bridge, ...) log_full_bridge(LOG_INFO, bridge, ##__VA_ARGS__) +#define log_notice_bridge(bridge, ...) log_full_bridge(LOG_NOTICE, bridge, ##__VA_ARGS__) +#define log_warning_bridge(bridge, ...) log_full_bridge(LOG_WARNING, bridge,## __VA_ARGS__) +#define log_error_bridge(bridge, ...) log_full_bridge(LOG_ERR, bridge, ##__VA_ARGS__) #define log_struct_bridge(level, bridge, ...) log_struct(level, "INTERFACE=%s", bridge->name, __VA_ARGS__) |