0
|
1 #include "Log.h"
|
|
2
|
|
3 #include <stdio.h>
|
|
4 #include <windows.h>
|
1481
|
5
|
0
|
6 HANDLE hStdOut = nullptr;
|
|
7
|
|
8
|
|
9 void Log::Initialize()
|
|
10 {
|
|
11 if (AllocConsole())
|
|
12 hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
13 }
|
|
14
|
|
15
|
|
16 void Log::Warning(const wchar_t *pFormat, ...)
|
|
17 {
|
|
18 if (!hStdOut)
|
|
19 return;
|
|
20
|
|
21 va_list args;
|
|
22
|
|
23 va_start(args, pFormat);
|
1481
|
24 vwprintf_s(pFormat, args);
|
0
|
25 va_end(args);
|
1481
|
26 puts("\r\n");
|
0
|
27
|
|
28 }
|
|
29
|
1297
|
30 //----- (004BE386) --------------------------------------------------------
|
|
31 void __fastcall log_error(const char *pMessage)
|
|
32 {
|
|
33 const char *v1; // edi@1
|
|
34 FILE *f; // eax@1
|
|
35 FILE *v3; // esi@1
|
|
36
|
|
37 v1 = pMessage;
|
|
38 f = fopen("errorlog.txt", "a");
|
|
39 v3 = f;
|
|
40 if ( f )
|
|
41 {
|
|
42 fprintf(f, "%s\n", v1);
|
|
43 fclose(v3);
|
|
44 fflush(v3);
|
|
45 }
|
|
46 } |