diff --git a/include/spdlog/common.h b/include/spdlog/common.h index 6783cf79..d078a1ab 100644 --- a/include/spdlog/common.h +++ b/include/spdlog/common.h @@ -64,6 +64,10 @@ #define SPDLOG_FILE_BASENAME(file) SPDLOG_STRRCHR("/" file, '/') + 1 #endif +#ifndef SPDLOG_FUNCTION +#define SPDLOG_FUNCTION __FUNCTION__ +#endif + namespace spdlog { class formatter; diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 3f394b29..20ff24be 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -311,10 +311,6 @@ inline void critical(const wchar_t *fmt, const Args &... args) // SPDLOG_LEVEL_OFF // -#ifndef SPDLOG_FUNCTION -#define SPDLOG_FUNCTION __FUNCTION__ -#endif - #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__)