mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 01:51:38 +08:00
Merge pull request #1055 from db-panda/v1.x
Fix unexpected log macro expansion.
This commit is contained in:
commit
536f5d8203
@ -327,8 +327,10 @@ inline void critical(const wchar_t *fmt, const Args &... args)
|
||||
//
|
||||
|
||||
#define SPDLOG_LOGGER_CALL(logger, level, ...) \
|
||||
if (logger->should_log(level)) \
|
||||
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__)
|
||||
do { \
|
||||
if (logger->should_log(level)) \
|
||||
logger->log(spdlog::source_loc{SPDLOG_FILE_BASENAME(__FILE__), __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
|
||||
#define SPDLOG_LOGGER_TRACE(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__)
|
||||
|
Loading…
Reference in New Issue
Block a user