mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-10 15:10:22 +01:00
systemd: fix systemd logging statements to show "file:line (func)" properly
Previously, we would stringify the arguments, resulting in logging
lines like
"__FILE__:__LINE__(__PRETTY_FUNCTION__): assert return: ..."
This commit is contained in:
parent
80d4fbf4ac
commit
1bc3e1d513
1 changed files with 5 additions and 3 deletions
|
|
@ -75,18 +75,20 @@ G_STMT_START { \
|
|||
|
||||
#define log_assert_failed(e, file, line, func) \
|
||||
G_STMT_START { \
|
||||
nm_log_err (LOGD_DHCP, #file ":" #line "(" #func "): assertion failed: " # e); \
|
||||
nm_log_err (LOGD_DHCP, "%s:%d (%s): assertion failed: %s", (""file), (line), (func), G_STRINGIFY (e)); \
|
||||
g_assert (FALSE); \
|
||||
} G_STMT_END
|
||||
|
||||
#define log_assert_failed_unreachable(t, file, line, func) \
|
||||
G_STMT_START { \
|
||||
nm_log_err (LOGD_DHCP, #file ":" #line "(" #func "): assert unreachable: " # t); \
|
||||
nm_log_err (LOGD_DHCP, "%s:%d (%s): assert unreachable: %s", (""file), (line), (func), G_STRINGIFY (t)); \
|
||||
g_assert_not_reached (); \
|
||||
} G_STMT_END
|
||||
|
||||
#define log_assert_failed_return(e, file, line, func) \
|
||||
nm_log_err (LOGD_DHCP, #file ":" #line "(" #func "): assert return: " # e); \
|
||||
G_STMT_START { \
|
||||
nm_log_err (LOGD_DHCP, "%s:%d (%s): assert return: %s", (""file), (line), (func), G_STRINGIFY (e)); \
|
||||
} G_STMT_END
|
||||
|
||||
#define log_oom nm_log_err(LOGD_CORE, "%s:%s/%s: OOM", __FILE__, __LINE__, __func__)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue