Created
September 15, 2016 19:44
-
-
Save MasashiWada/55aba070057b0d18d4e690dc03189118 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void LogInternalW(const TCHAR* format, const char*file, const int line, ...) | |
| { | |
| TCHAR nfmt[1010]; | |
| { | |
| TCHAR c[1010]; | |
| WCHAR wfile[204]; | |
| size_t len = 0; | |
| int l; | |
| va_list argList; | |
| memset(c, 0, sizeof(c)); | |
| va_start(argList, line); | |
| l = _vstprintf_s(c, 1010, format, argList); | |
| va_end(argList); | |
| c[l] = 0; | |
| mbstowcs_s(&len, wfile, 200, file, _TRUNCATE); | |
| wfile[len] = 0; | |
| l = _stprintf_s(nfmt, 1000, _T("%s (%s:%d)\n"), c, wfile, line); | |
| nfmt[l] = 0; | |
| } | |
| OutputDebugString(nfmt); | |
| } | |
| #define Log(fmt,...) LogInternalW(fmt,__FILE__,__LINE__,__VA_ARGS__) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VC++で使いたいので無くさないように書き足しました。
ワイド文字ビルド環境前提です。