| 99 | |
| 100 | |
| 101 | void LOG_W(int verbosity, const wchar_t* format, ...) |
| 102 | { |
| 103 | WCHAR wide_message[DATA_BUFFER_SIZE] = L"[RedEdr PPL] "; |
| 104 | size_t offset = wcslen(wide_message); |
| 105 | |
| 106 | va_list arg_ptr; |
| 107 | va_start(arg_ptr, format); |
| 108 | int ret = vswprintf(&wide_message[offset], DATA_BUFFER_SIZE - offset, format, arg_ptr); |
| 109 | va_end(arg_ptr); |
| 110 | |
| 111 | // Convert wide string to UTF-8 |
| 112 | char message[DATA_BUFFER_SIZE]; |
| 113 | int result = WideCharToMultiByte(CP_UTF8, 0, wide_message, -1, message, sizeof(message), NULL, NULL); |
| 114 | if (result > 0) { |
| 115 | WriteToLogFile(message); |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | |
| 120 | void CleanupFileLogging() { |
no test coverage detected