From bd9479cc1a60df143f2e9167ef39b3c9be8aa300 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 5 Feb 2016 10:48:05 +0100 Subject: [PATCH] platform: swap _LOG2t() and _LOG2T() macros To be consistent with _LOGT()/_LOGt() and consistent with _LOG2D(). The upper cased macro logs always, the lower cased macro is disabled by default. --- src/nm-logging.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nm-logging.h b/src/nm-logging.h index 19b965f8f3..e04e6da201 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -206,30 +206,30 @@ void nm_logging_syslog_openlog (const char *logging_backend); * use. As with the _LOGD() macro familiy above, the exact implementation * depends on the file that uses them. * Still, it encourages a common pattern to have the common set of macros - * like _LOG2D(), _LOG2I(), etc. and have _LOG2T() which by default + * like _LOG2D(), _LOG2I(), etc. and have _LOG2t() which by default * is disabled at compile time. */ #define _NMLOG2_ENABLED(level) ( nm_logging_enabled ((level), (_NMLOG2_DOMAIN)) ) -#define _LOG2t(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) +#define _LOG2T(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) #define _LOG2D(...) _NMLOG2 (LOGL_DEBUG, __VA_ARGS__) #define _LOG2I(...) _NMLOG2 (LOGL_INFO , __VA_ARGS__) #define _LOG2W(...) _NMLOG2 (LOGL_WARN , __VA_ARGS__) #define _LOG2E(...) _NMLOG2 (LOGL_ERR , __VA_ARGS__) -#define _LOG2t_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) +#define _LOG2T_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) #define _LOG2D_ENABLED(...) _NMLOG2_ENABLED (LOGL_DEBUG, ##__VA_ARGS__) #define _LOG2I_ENABLED(...) _NMLOG2_ENABLED (LOGL_INFO , ##__VA_ARGS__) #define _LOG2W_ENABLED(...) _NMLOG2_ENABLED (LOGL_WARN , ##__VA_ARGS__) #define _LOG2E_ENABLED(...) _NMLOG2_ENABLED (LOGL_ERR , ##__VA_ARGS__) #ifdef NM_MORE_LOGGING -#define _LOG2T_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) -#define _LOG2T(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) +#define _LOG2t_ENABLED(...) _NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__) +#define _LOG2t(...) _NMLOG2 (LOGL_TRACE, __VA_ARGS__) #else /* still call the logging macros to get compile time checks, but they will be optimized out. */ -#define _LOG2T_ENABLED(...) ( FALSE && (_NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__)) ) -#define _LOG2T(...) G_STMT_START { if (FALSE) { _NMLOG2 (LOGL_TRACE, __VA_ARGS__); } } G_STMT_END +#define _LOG2t_ENABLED(...) ( FALSE && (_NMLOG2_ENABLED (LOGL_TRACE, ##__VA_ARGS__)) ) +#define _LOG2t(...) G_STMT_START { if (FALSE) { _NMLOG2 (LOGL_TRACE, __VA_ARGS__); } } G_STMT_END #endif /*****************************************************************************/