Mercurial > mm7
view Log.cpp @ 1205:8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
author | Grumpy7 |
---|---|
date | Sun, 09 Jun 2013 00:30:48 +0200 |
parents | 9c0607679772 |
children | 5450af4f57ef |
line wrap: on
line source
#include "Log.h" #include <stdio.h> #include <windows.h> HANDLE hStdOut = nullptr; void Log::Initialize() { if (AllocConsole()) hStdOut = GetStdHandle(STD_OUTPUT_HANDLE); } void Log::Warning(const wchar_t *pFormat, ...) { if (!hStdOut) return; va_list args; wchar_t pMsg[8192]; va_start(args, pFormat); vswprintf_s(pMsg, 8192, pFormat, args); va_end(args); DWORD w; WriteConsole(hStdOut, pMsg, lstrlenW(pMsg), &w, nullptr); WriteConsole(hStdOut, L"\r\n", 2, &w, nullptr); }