mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 03:20:34 +01:00
logging: add logging macro _nm_log() that logs unconditionally
This commit is contained in:
parent
211d241ab0
commit
fb9f8c69f7
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue