aboutsummaryrefslogtreecommitdiffstats
path: root/core/logging.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-11-21 21:21:46 -0800
committerChris Robinson <[email protected]>2021-11-21 21:21:46 -0800
commit3ef4bffaf959d06527a247faa19cc869781745e4 (patch)
tree56a1ad4d0645f2adda09e039724dc13ecb0991fe /core/logging.cpp
parent834800c817b3a7b799fc387b51777d555494f91a (diff)
Slightly improve logging on Windows
The characters won't display properly if the system codepage isn't UTF-8, but at least it shouldn't cut the line off prematurely.
Diffstat (limited to 'core/logging.cpp')
-rw-r--r--core/logging.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/logging.cpp b/core/logging.cpp
index 91cb0e8c..7ee7ff23 100644
--- a/core/logging.cpp
+++ b/core/logging.cpp
@@ -35,10 +35,9 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...)
va_end(args2);
va_end(args);
- std::wstring wstr{utf8_to_wstr(str)};
if(gLogLevel >= level)
{
- fputws(wstr.c_str(), logfile);
+ fputs(str, logfile);
fflush(logfile);
}
/* OutputDebugStringW has no 'level' property to distinguish between
@@ -46,6 +45,7 @@ void al_print(LogLevel level, FILE *logfile, const char *fmt, ...)
* non-Release builds.
*/
#ifndef NDEBUG
+ std::wstring wstr{utf8_to_wstr(str)};
OutputDebugStringW(wstr.c_str());
#endif
}