From df45d78d143af03e76e54ce7d86eaea40ba37362 Mon Sep 17 00:00:00 2001 From: Wolfgang Petroschka Date: Fri, 13 Aug 2021 13:53:35 +0200 Subject: [PATCH] Windows/wchar problems Mixing char types in libfmt is a problem and WIP. --- include/spdlog/async_logger-inl.h | 6 +----- include/spdlog/logger-inl.h | 6 +----- include/spdlog/logger.h | 8 ++++++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/spdlog/async_logger-inl.h b/include/spdlog/async_logger-inl.h index db449d61..9f94d14f 100644 --- a/include/spdlog/async_logger-inl.h +++ b/include/spdlog/async_logger-inl.h @@ -80,11 +80,7 @@ SPDLOG_INLINE void spdlog::async_logger::backend_flush_() { sink->flush(); } -#if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32) - SPDLOG_LOGGER_CATCH(wstring_view_t()) -#else - SPDLOG_LOGGER_CATCH(string_view_t()) -#endif + SPDLOG_LOGGER_CATCH("") } } diff --git a/include/spdlog/logger-inl.h b/include/spdlog/logger-inl.h index 9d6e082e..c44caff3 100644 --- a/include/spdlog/logger-inl.h +++ b/include/spdlog/logger-inl.h @@ -203,11 +203,7 @@ SPDLOG_INLINE void logger::flush_() { sink->flush(); } -#if (defined(SPDLOG_WCHAR_TO_UTF8_SUPPORT) || defined(SPDLOG_WCHAR_FILENAMES)) && defined(_WIN32) - SPDLOG_LOGGER_CATCH(wstring_view_t()) -#else - SPDLOG_LOGGER_CATCH(string_view_t()) -#endif + SPDLOG_LOGGER_CATCH("") } } diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 43ac4fb4..6cc70dd5 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -356,7 +356,9 @@ protected: details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())); log_it_(log_msg, log_enabled, traceback_enabled); } - SPDLOG_LOGGER_CATCH(fmt) + // TODO: This isn't working yet. + SPDLOG_LOGGER_CATCH("") + //SPDLOG_LOGGER_CATCH(fmt) } // T can be statically converted to wstring_view, and no formatting needed. @@ -376,7 +378,9 @@ protected: details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size())); log_it_(log_msg, log_enabled, traceback_enabled); } - SPDLOG_LOGGER_CATCH(msg) + // TODO: This isn't working yet. + SPDLOG_LOGGER_CATCH("") + //SPDLOG_LOGGER_CATCH(msg) } #endif // SPDLOG_WCHAR_TO_UTF8_SUPPORT