summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-04-21 17:40:18 +0200
committerLennart Poettering <lennart@poettering.net>2015-04-21 17:43:55 +0200
commit6a7a4e4d0a057febab787a2d5d3e0b52d2db2268 (patch)
treef9cd7704d51916281290e59740934b9b40365387 /src/network/networkd-netdev.h
parentfed2b07ebc9e8694b5b326923356028f464381ce (diff)
networkd: improve how networkd logs things
This makes adds a couple of fixes: - Introduces log_netdev_error_errno() and friends, which takes an error number, and matches what log_link_error_errno() and friends do. - Replaces a lof ot strerror() usage with log_netdev_error_errno(), log_link_error_errno() and log_erro_errno() - Uppercases the first character of many log messages, after all this is supposed to be english language - Drops manual negating of error codes before passing them to log functions, the log functions all do that internally anyway. Some other minor fixes. Behaviour should not change really.
Diffstat (limited to 'src/network/networkd-netdev.h')
-rw-r--r--src/network/networkd-netdev.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/network/networkd-netdev.h b/src/network/networkd-netdev.h
index 5f5fcfb082..ff0606715f 100644
--- a/src/network/networkd-netdev.h
+++ b/src/network/networkd-netdev.h
@@ -200,12 +200,20 @@ const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, unsign
/* Macros which append INTERFACE= to the message */
-#define log_netdev_full(level, netdev, fmt, ...) log_object_internal(level, 0, __FILE__, __LINE__, __func__, "INTERFACE=", netdev->ifname, "%-*s: " fmt, IFNAMSIZ, netdev->ifname, ##__VA_ARGS__)
-#define log_netdev_debug(netdev, ...) log_netdev_full(LOG_DEBUG, netdev, ##__VA_ARGS__)
-#define log_netdev_info(netdev, ...) log_netdev_full(LOG_INFO, netdev, ##__VA_ARGS__)
-#define log_netdev_notice(netdev, ...) log_netdev_full(LOG_NOTICE, netdev, ##__VA_ARGS__)
-#define log_netdev_warning(netdev, ...) log_netdev_full(LOG_WARNING, netdev,## __VA_ARGS__)
-#define log_netdev_error(netdev, ...) log_netdev_full(LOG_ERR, netdev, ##__VA_ARGS__)
+#define log_netdev_full(netdev, level, error, fmt, ...) \
+ log_object_internal(level, error, __FILE__, __LINE__, __func__, "INTERFACE=", netdev->ifname, "%-*s: " fmt, IFNAMSIZ, netdev->ifname, ##__VA_ARGS__)
+
+#define log_netdev_debug(netdev, ...) log_netdev_full(netdev, LOG_DEBUG, 0, ##__VA_ARGS__)
+#define log_netdev_info(netdev, ...) log_netdev_full(netdev, LOG_INFO, 0, ##__VA_ARGS__)
+#define log_netdev_notice(netdev, ...) log_netdev_full(netdev, LOG_NOTICE, 0, ##__VA_ARGS__)
+#define log_netdev_warning(netdev, ...) log_netdev_full(netdev, LOG_WARNING, 0, ## __VA_ARGS__)
+#define log_netdev_error(netdev, ...) log_netdev_full(netdev, LOG_ERR, 0, ##__VA_ARGS__)
+
+#define log_netdev_debug_errno(netdev, error, ...) log_netdev_full(netdev, LOG_DEBUG, error, ##__VA_ARGS__)
+#define log_netdev_info_errno(netdev, error, ...) log_netdev_full(netdev, LOG_INFO, error, ##__VA_ARGS__)
+#define log_netdev_notice_errno(netdev, error, ...) log_netdev_full(netdev, LOG_NOTICE, error, ##__VA_ARGS__)
+#define log_netdev_warning_errno(netdev, error, ...) log_netdev_full(netdev, LOG_WARNING, error, ##__VA_ARGS__)
+#define log_netdev_error_errno(netdev, error, ...) log_netdev_full(netdev, LOG_ERR, error, ##__VA_ARGS__)
#define log_netdev_struct(level, netdev, ...) log_struct(level, "INTERFACE=%s", netdev->ifname, __VA_ARGS__)