wslog: Avoid macro duplication

This commit is contained in:
João Valverde 2021-07-28 20:12:56 +01:00
parent 62c7734e64
commit 0983eb2456
1 changed files with 7 additions and 6 deletions

View File

@ -20,6 +20,12 @@
#include <ws_log_defs.h>
#ifdef WS_LOG_DOMAIN
#define _LOG_DOMAIN WS_LOG_DOMAIN
#else
#define _LOG_DOMAIN ""
#endif
/*
* Define the macro WS_LOG_DOMAIN *before* including this header,
* for example:
@ -228,13 +234,8 @@ void ws_logv_full(const char *domain, enum ws_log_level level,
const char *format, va_list ap);
#ifdef WS_LOG_DOMAIN
#define _LOG_FULL(level, ...) ws_log_full(WS_LOG_DOMAIN, level, \
#define _LOG_FULL(level, ...) ws_log_full(_LOG_DOMAIN, level, \
__FILE__, __LINE__, G_STRFUNC, __VA_ARGS__)
#else
#define _LOG_FULL(level, ...) ws_log_full(NULL, level, \
__FILE__, __LINE__, G_STRFUNC, __VA_ARGS__)
#endif
/** Logs with "error" level.
*