diff --git a/src/nm-logging.h b/src/nm-logging.h index 0d15f9fc7a..be453a20b7 100644 --- a/src/nm-logging.h +++ b/src/nm-logging.h @@ -99,12 +99,20 @@ typedef enum { /*< skip >*/ #define nm_log_dbg(domain, ...) nm_log (LOGL_DEBUG, (domain), __VA_ARGS__) #define nm_log_trace(domain, ...) nm_log (LOGL_TRACE, (domain), __VA_ARGS__) +/* A wrapper for the _nm_log_impl() function that adds call site information. + * Contrary to nm_log(), it unconditionally calls the function without + * checking whether logging for the given level and domain is enabled. */ +#define _nm_log(level, domain, error, ...) \ + G_STMT_START { \ + _nm_log_impl (__FILE__, __LINE__, G_STRFUNC, (level), (domain), (error), ""__VA_ARGS__); \ + } G_STMT_END + /* nm_log() only evaluates it's argument list after checking * whether logging for the given level/domain is enabled. */ #define nm_log(level, domain, ...) \ G_STMT_START { \ if (nm_logging_enabled ((level), (domain))) { \ - _nm_log_impl (__FILE__, __LINE__, G_STRFUNC, (level), (domain), 0, ""__VA_ARGS__); \ + _nm_log (level, domain, 0, __VA_ARGS__); \ } \ } G_STMT_END