mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-05 07:40:49 +00:00
dhcp: fix adapter for sd logging macros to show file location
Previously we were logging: <debug> [1415715440.639086] [__FILE__:__LINE__] client_set_lease_timeouts(): DHCP CLIENT (0xcf221f86): T1 expires in 11h 59min 53.566147s Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
142dbf213e
commit
900763ce0f
|
@ -54,8 +54,11 @@ _slog_level_to_nm (int slevel)
|
|||
#define log_meta(level, file, line, func, format, ...) \
|
||||
G_STMT_START { \
|
||||
guint32 _l = _slog_level_to_nm ((level)); \
|
||||
if (nm_logging_enabled (_l, LOGD_DHCP)) \
|
||||
_nm_log (#file ":" #line, func, _l, LOGD_DHCP, format, ## __VA_ARGS__); \
|
||||
if (nm_logging_enabled (_l, LOGD_DHCP)) { \
|
||||
const char *_location = strrchr ((file ":" G_STRINGIFY(line)), '/'); \
|
||||
\
|
||||
_nm_log (_location ? _location + 1 : (file ":" G_STRINGIFY(line)), func, _l, LOGD_DHCP, format, ## __VA_ARGS__); \
|
||||
} \
|
||||
} G_STMT_END
|
||||
|
||||
#define log_debug(...) log_full(LOG_DEBUG, __VA_ARGS__)
|
||||
|
|
Loading…
Reference in a new issue