diff options
Diffstat (limited to 'src/network/networkd-link.h')
-rw-r--r-- | src/network/networkd-link.h | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index 61cdbf3132..56631757a9 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -132,14 +132,22 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Link*, link_unref); /* Macros which append INTERFACE= to the message */ -#define log_link_full(level, link, fmt, ...) log_object_internal(level, 0, __FILE__, __LINE__, __func__, "INTERFACE=", link->ifname, "%-*s: " fmt, IFNAMSIZ, link->ifname, ##__VA_ARGS__) -#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_link_struct(level, link, ...) log_struct(level, "INTERFACE=%s", link->ifname, __VA_ARGS__) +#define log_link_full(link, level, error, fmt, ...) \ + log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", link->ifname, "%-*s: " fmt, IFNAMSIZ, link->ifname, ##__VA_ARGS__) + +#define log_link_debug(link, ...) log_link_full(link, LOG_DEBUG, 0, ##__VA_ARGS__) +#define log_link_info(link, ...) log_link_full(link, LOG_INFO, 0, ##__VA_ARGS__) +#define log_link_notice(link, ...) log_link_full(link, LOG_NOTICE, 0, ##__VA_ARGS__) +#define log_link_warning(link, ...) log_link_full(link, LOG_WARNING, 0, ##__VA_ARGS__) +#define log_link_error(link, ...) log_link_full(link, LOG_ERR, 0, ##__VA_ARGS__) + +#define log_link_debug_errno(link, error, ...) log_link_full(link, LOG_DEBUG, error, ##__VA_ARGS__) +#define log_link_info_errno(link, error, ...) log_link_full(link, LOG_INFO, error, ##__VA_ARGS__) +#define log_link_notice_errno(link, error, ...) log_link_full(link, LOG_NOTICE, error, ##__VA_ARGS__) +#define log_link_warning_errno(link, error, ...) log_link_full(link, LOG_WARNING, error, ##__VA_ARGS__) +#define log_link_error_errno(link, error, ...) log_link_full(link, LOG_ERR, error, ##__VA_ARGS__) + +#define log_link_struct(link, level, ...) log_struct(level, "INTERFACE=%s", link->ifname, __VA_ARGS__) #define ADDRESS_FMT_VAL(address) \ (address).s_addr & 0xFF, \ |