MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / Log

Method Log

LuaSTGPlus/LogSystem.cpp:24–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22}
23
24LNOINLINE void LogSystem::Log(LogType type, const wchar_t* info, ...)throw()
25{
26 wstring tRet;
27
28 try
29 {
30 switch (type)
31 {
32 case LogType::Error:
33 tRet = L"[ERRO] ";
34 break;
35 case LogType::Warning:
36 tRet = L"[WARN] ";
37 break;
38 default:
39 tRet = L"[INFO] ";
40 break;
41 }
42
43 va_list vargs;
44 va_start(vargs, info);
45 tRet += std::move(StringFormatV(info, vargs));
46 va_end(vargs);
47 tRet.push_back(L'\n');
48 }
49 catch (const bad_alloc&)
50 {
51 OutputDebugString(L"[ERRO] ��¼��־ʱ�����ڴ治�����");
52 return;
53 }
54
55 OutputDebugString(tRet.c_str());
56 try
57 {
58 if (m_LogFile)
59 {
60 m_LogFile << std::move(fcyStringHelper::WideCharToMultiByte(tRet, CP_UTF8));
61 m_LogFile.flush();
62 }
63 }
64 catch (const bad_alloc&)
65 {
66 OutputDebugString(L"[ERRO] ��¼��־ʱ�����ڴ治�����");
67 return;
68 }
69}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected