| 13 | |
| 14 | #ifndef SILENT |
| 15 | void Log(const wchar *ArcName,const wchar *fmt,...) |
| 16 | { |
| 17 | // Preserve the error code for possible following system error message. |
| 18 | int Code=ErrHandler.GetSystemErrorCode(); |
| 19 | |
| 20 | uiAlarm(UIALARM_ERROR); |
| 21 | |
| 22 | // This buffer is for format string only, not for entire output, |
| 23 | // so it can be short enough. |
| 24 | wchar fmtw[1024]; |
| 25 | PrintfPrepareFmt(fmt,fmtw,ASIZE(fmtw)); |
| 26 | |
| 27 | safebuf wchar Msg[2*NM+1024]; |
| 28 | va_list arglist; |
| 29 | va_start(arglist,fmt); |
| 30 | vswprintf(Msg,ASIZE(Msg),fmtw,arglist); |
| 31 | va_end(arglist); |
| 32 | eprintf(L"%ls",Msg); |
| 33 | ErrHandler.SetSystemErrorCode(Code); |
| 34 | } |
| 35 | #endif |
| 36 | |
| 37 |
no test coverage detected