diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-11-19 15:00:04 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-11-19 15:00:04 +0100 |
commit | d4e522e2623b456d226ef8ecb7b2300f9556cd0c (patch) | |
tree | 7c1a7e9c19af6c8c174844451e54fb742f2c6dfb | |
parent | 99ed78ba7feb3a39f40f5f9808b9be10a18f3323 (diff) | |
download | NetworkManager-bg/nettools-log.tar.gz |
fixup! n-dhcp4: add logging APIbg/nettools-log
-rw-r--r-- | shared/n-dhcp4/src/n-dhcp4-private.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/shared/n-dhcp4/src/n-dhcp4-private.h b/shared/n-dhcp4/src/n-dhcp4-private.h index 6d9218ca76..fa2fda38de 100644 --- a/shared/n-dhcp4/src/n-dhcp4-private.h +++ b/shared/n-dhcp4/src/n-dhcp4-private.h @@ -695,13 +695,18 @@ static inline uint64_t n_dhcp4_gettime(clockid_t clock) { return ts.tv_sec * 1000ULL * 1000ULL * 1000ULL + ts.tv_nsec; } -#define n_dhcp4_c_log(_config, _level, _fmt, ...) \ +#define n_dhcp4_c_log(_config, _level, ...) \ do { \ const NDhcp4ClientConfig *__config = _config; \ \ if (_level <= __config->log.level && __config->log.func) { \ - _config->log.func(_level, \ - __config->log.data, \ - _fmt, __VA_ARGS__); \ + if (1) { \ + _config->log.func(_level, \ + __config->log.data, \ + __VA_ARGS__); \ + } else { \ + /* To have the compiler check arguments */ \ + printf(__VA_ARGS__); \ + } \ } \ } while (0) |