diff options
author | Thomas Haller <thaller@redhat.com> | 2015-04-24 13:51:28 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-17 14:45:46 +0200 |
commit | 093b29a618106a71f7b6866022ee1ef9a6582751 (patch) | |
tree | 6ff0a59560aff31daf6fc94b26d47d828979a3fc | |
parent | 72c0379708f6d623a797f881b2f64b7959e8b67c (diff) | |
download | NetworkManager-093b29a618106a71f7b6866022ee1ef9a6582751.tar.gz |
logging: define _LOGT() macro to check valid arguments
With NM_MORE_LOGGING disabled, we still want the compiler to evaluate
the argument list. By wrapping it in "if(FALSE)", we get compile time
checks, but the logging statement will be optimized out.
(cherry picked from commit cb6bafb9af721fcd2295b4da73f4a7812eb4f3e8)
-rw-r--r-- | src/platform/nm-linux-platform.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index bb15759dae..97ce2605cb 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -99,7 +99,7 @@ #define _LOGT(...) _LOG (LOGL_TRACE, _LOG_DOMAIN, platform, __VA_ARGS__) #else #define _LOGT_ENABLED() FALSE -#define _LOGT(...) G_STMT_START { (void) 0; } G_STMT_END +#define _LOGT(...) G_STMT_START { if (FALSE) { _LOG (LOGL_TRACE, _LOG_DOMAIN, platform, __VA_ARGS__); } } G_STMT_END #endif #define _LOGD(...) _LOG (LOGL_DEBUG, _LOG_DOMAIN, platform, __VA_ARGS__) |