Fixed wchar support in messages

This commit is contained in:
gabime
2018-07-10 17:01:49 +03:00
parent 898e1f2641
commit 81f29a9a7a
3 changed files with 23 additions and 20 deletions

View File

@@ -63,10 +63,7 @@ public:
template<typename... Args>
void critical(const char *fmt, const Args &... args);
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
template<typename... Args>
void log(level::level_enum lvl, const wchar_t *msg);
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
template<typename... Args>
void log(level::level_enum lvl, const wchar_t *fmt, const Args &... args);
@@ -152,6 +149,11 @@ protected:
log_err_handler err_handler_;
std::atomic<time_t> last_err_time_;
std::atomic<size_t> msg_counter_;
#ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT
std::wstring_convert<std::codecvt_utf8<wchar_t>> wstring_converter_;
std::mutex wstring_converter_mutex_;
#endif
};
} // namespace spdlog