From 5993e78aac3fb1eaa0c601b8dcf4a6d637e413ec Mon Sep 17 00:00:00 2001 From: gabime Date: Fri, 28 Jul 2023 19:07:32 +0300 Subject: [PATCH] Removed SPDLOG_WCHAR_SUPPORT macro --- CMakeLists.txt | 2 -- appveyor.yml | 9 +-------- include/spdlog/logger.h | 2 ++ 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4a02096..1986513e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,10 +101,8 @@ endif() # misc tweakme options if(WIN32) - option(SPDLOG_WCHAR_SUPPORT "Support wchar api" OFF) option(SPDLOG_WCHAR_FILENAMES "Support wchar filenames" OFF) else() - set(SPDLOG_WCHAR_SUPPORT OFF CACHE BOOL "non supported option" FORCE) set(SPDLOG_WCHAR_FILENAMES OFF CACHE BOOL "non supported option" FORCE) endif() diff --git a/appveyor.yml b/appveyor.yml index f2757f30..23e1676a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,6 @@ environment: BUILD_TYPE: Debug BUILD_SHARED: 'OFF' FATAL_ERRORS: 'OFF' - WCHAR: 'ON' WCHAR_FILES: 'OFF' BUILD_EXAMPLE: 'ON' USE_STD_FORMAT: 'OFF' @@ -15,7 +14,6 @@ environment: BUILD_TYPE: Release BUILD_SHARED: 'OFF' FATAL_ERRORS: 'OFF' - WCHAR: 'OFF' WCHAR_FILES: 'OFF' BUILD_EXAMPLE: 'ON' USE_STD_FORMAT: 'OFF' @@ -24,7 +22,6 @@ environment: BUILD_TYPE: Release BUILD_SHARED: 'ON' FATAL_ERRORS: 'OFF' - WCHAR: 'OFF' WCHAR_FILES: 'OFF' BUILD_EXAMPLE: 'ON' USE_STD_FORMAT: 'OFF' @@ -33,7 +30,6 @@ environment: BUILD_TYPE: Release BUILD_SHARED: 'ON' FATAL_ERRORS: 'OFF' - WCHAR: 'ON' WCHAR_FILES: 'ON' BUILD_EXAMPLE: 'OFF' USE_STD_FORMAT: 'OFF' @@ -42,7 +38,6 @@ environment: BUILD_TYPE: Release BUILD_SHARED: 'ON' FATAL_ERRORS: 'ON' - WCHAR: 'OFF' WCHAR_FILES: 'OFF' BUILD_EXAMPLE: 'OFF' USE_STD_FORMAT: 'OFF' @@ -52,7 +47,6 @@ environment: BUILD_TYPE: Release BUILD_SHARED: 'ON' FATAL_ERRORS: 'ON' - WCHAR: 'OFF' WCHAR_FILES: 'OFF' BUILD_EXAMPLE: 'OFF' USE_STD_FORMAT: 'ON' @@ -62,7 +56,6 @@ environment: BUILD_TYPE: Release BUILD_SHARED: 'ON' FATAL_ERRORS: 'ON' - WCHAR: 'ON' WCHAR_FILES: 'ON' BUILD_EXAMPLE: 'OFF' USE_STD_FORMAT: 'ON' @@ -78,7 +71,7 @@ build_script: set PATH=%PATH%;C:\Program Files\Git\usr\bin - cmake -G %GENERATOR% -D CMAKE_BUILD_TYPE=%BUILD_TYPE% -D BUILD_SHARED_LIBS=%BUILD_SHARED% -D SPDLOG_WCHAR_SUPPORT=%WCHAR% -D SPDLOG_WCHAR_FILENAMES=%WCHAR_FILES% -D SPDLOG_BUILD_EXAMPLE=%BUILD_EXAMPLE% -D SPDLOG_BUILD_EXAMPLE_HO=%BUILD_EXAMPLE% -D SPDLOG_BUILD_TESTS=ON -D SPDLOG_BUILD_TESTS_HO=OFF -D SPDLOG_BUILD_WARNINGS=%FATAL_ERRORS% -D SPDLOG_USE_STD_FORMAT=%USE_STD_FORMAT% -D CMAKE_CXX_STANDARD=%CXX_STANDARD% .. + cmake -G %GENERATOR% -D CMAKE_BUILD_TYPE=%BUILD_TYPE% -D BUILD_SHARED_LIBS=%BUILD_SHARED% -D SPDLOG_WCHAR_FILENAMES=%WCHAR_FILES% -D SPDLOG_BUILD_EXAMPLE=%BUILD_EXAMPLE% -D SPDLOG_BUILD_EXAMPLE_HO=%BUILD_EXAMPLE% -D SPDLOG_BUILD_TESTS=ON -D SPDLOG_BUILD_TESTS_HO=OFF -D SPDLOG_BUILD_WARNINGS=%FATAL_ERRORS% -D SPDLOG_USE_STD_FORMAT=%USE_STD_FORMAT% -D CMAKE_CXX_STANDARD=%CXX_STANDARD% .. cmake --build . --config %BUILD_TYPE% diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 7faee552..a6dea987 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -19,6 +19,7 @@ #include #include +#include #ifndef SPDLOG_NO_EXCEPTIONS # define SPDLOG_LOGGER_CATCH(location) \ @@ -266,6 +267,7 @@ protected: // log the given message (if the given log level is high enough) virtual void sink_it_(const details::log_msg &msg) { + assert (should_log(msg.level)); for (auto &sink : sinks_) { if (sink->should_log(msg.level))