Refactoring to better support backtrace

This commit is contained in:
gabime
2019-08-27 00:56:49 +03:00
parent 04a8485b17
commit e1be7f3d6f
4 changed files with 28 additions and 74 deletions

View File

@@ -285,12 +285,8 @@ inline void critical(wstring_view_t fmt, const Args &... args)
// SPDLOG_LEVEL_OFF
//
#define SPDLOG_LOGGER_CALL(logger, level, ...) \
do \
{ \
if (logger->should_log(level)) \
logger->force_log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
} while (0)
#define SPDLOG_LOGGER_CALL(logger, level, ...)\
logger->log(spdlog::source_loc{__FILE__, __LINE__, SPDLOG_FUNCTION}, level, __VA_ARGS__); \
#if SPDLOG_ACTIVE_LEVEL <= SPDLOG_LEVEL_TRACE
#define SPDLOG_LOGGER_TRACE(logger, ...) SPDLOG_LOGGER_CALL(logger, spdlog::level::trace, __VA_ARGS__)