Merge remote-tracking branch 'origin/utf8' into utf8

# Conflicts:
#	lib/logvisor.cpp
This commit is contained in:
Luke Street 2021-06-29 00:09:20 -04:00
commit 6eadd55f7a

View File

@ -468,8 +468,6 @@ struct ConsoleLogger : public ILogger {
SendBuffer(bufOut); SendBuffer(bufOut);
} }
void report(const char* modName, Level severity, fmt::wstring_view format, fmt::wformat_args args) override {}
void reportSource(const char* modName, Level severity, const char* file, unsigned linenum, fmt::string_view format, void reportSource(const char* modName, Level severity, const char* file, unsigned linenum, fmt::string_view format,
fmt::format_args args) override { fmt::format_args args) override {
if (!m_ready) if (!m_ready)
@ -528,9 +526,6 @@ struct ConsoleLogger : public ILogger {
SendBuffer(bufOut); SendBuffer(bufOut);
} }
void reportSource(const char* modName, Level severity, const char* file, unsigned linenum, fmt::wstring_view format,
fmt::wformat_args args) override {}
}; };
#else #else
@ -701,10 +696,14 @@ void RegisterConsoleLogger() {
if (!ConsoleLoggerRegistered) { if (!ConsoleLoggerRegistered) {
MainLoggers.emplace_back(new ConsoleLogger); MainLoggers.emplace_back(new ConsoleLogger);
ConsoleLoggerRegistered = true; ConsoleLoggerRegistered = true;
#if _WIN32 && 0 #if _WIN32
#if 0
if (GetACP() != CP_UTF8) { if (GetACP() != CP_UTF8) {
Log.report(Fatal, FMT_STRING("UTF-8 codepage not active! (Windows 10 1903+ required)")); Log.report(Fatal, FMT_STRING("UTF-8 codepage not active! (Windows 10 1903+ required)"));
} }
#else
SetConsoleOutputCP(CP_UTF8);
#endif
#endif #endif
} }
} }
@ -828,7 +827,7 @@ struct FileLogger : public ILogger {
struct FileLogger8 : public FileLogger { struct FileLogger8 : public FileLogger {
const char* m_filepath; const char* m_filepath;
explicit FileLogger8(const char* filepath) : FileLogger(log_typeid(FileLogger8)), m_filepath(filepath) {} explicit FileLogger8(const char* filepath) : FileLogger(log_typeid(FileLogger8)), m_filepath(filepath) {}
void openFile() override { fp = std::fopen(m_filepath, "ae"); } void openFile() override { fp = std::fopen(m_filepath, "a"); }
~FileLogger8() override = default; ~FileLogger8() override = default;
}; };