Moved function to inner scope.

This commit is contained in:
2023-12-07 19:54:34 +03:00
parent d0f211d931
commit 76be5eb941

View File

@@ -46,7 +46,6 @@ void CLogger::Out(const wchar_t* fmt, ...) {
}
void CLogger::Init() {
InitializeCriticalSection(&cs);
wchar_t szPath[MAX_PATH] = { 0 };
DWORD dwPathLength = GetModuleFileNameW(NULL, szPath, MAX_PATH);
DWORD dwError = GetLastError();
@@ -70,6 +69,7 @@ void CLogger::Init() {
#endif
fsLogFile.open(log_path, std::ios::trunc);
if (fsLogFile.is_open()) {
InitializeCriticalSection(&cs);
fsLogFile << "\xEF\xBB\xBF"; // (0xEF, 0xBB, 0xBF) - UTF-8 BOM
fsLogFile.imbue(std::locale("en-US.utf8"));
fsLogFile << GetTimeStamp() << "[ " << szAppTitleVer.c_str() << " ] Start log." << std::endl;