1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs)
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "log.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
33 #include "wx/string.h"
38 #include "wx/window.h"
39 #include "wx/msgdlg.h"
41 #include "wx/msw/private.h"
47 #include "wx/textfile.h"
49 #include "wx/wxchar.h"
51 #include "wx/thread.h"
55 // other standard headers
60 #if defined(__WXMSW__)
61 #include "wx/msw/private.h" // includes windows.h for OutputDebugString
64 #if defined(__WXMAC__)
65 #include "wx/mac/private.h" // includes mac headers
68 #if defined(__MWERKS__) && wxUSE_UNICODE
73 // ----------------------------------------------------------------------------
74 // non member functions
75 // ----------------------------------------------------------------------------
77 // define this to enable wrapping of log messages
78 //#define LOG_PRETTY_WRAP
80 #ifdef LOG_PRETTY_WRAP
81 static void wxLogWrap(FILE *f
, const char *pszPrefix
, const char *psz
);
84 // ============================================================================
86 // ============================================================================
88 // ----------------------------------------------------------------------------
90 // ----------------------------------------------------------------------------
92 // log functions can't allocate memory (LogError("out of memory...") should
93 // work!), so we use a static buffer for all log messages
94 #define LOG_BUFFER_SIZE (4096)
96 // static buffer for error messages
97 static wxChar s_szBufStatic
[LOG_BUFFER_SIZE
];
99 static wxChar
*s_szBuf
= s_szBufStatic
;
100 static size_t s_szBufSize
= WXSIZEOF( s_szBufStatic
);
104 // the critical section protecting the static buffer
105 static wxCriticalSection gs_csLogBuf
;
107 #endif // wxUSE_THREADS
109 // return true if we have a non NULL non disabled log target
110 static inline bool IsLoggingEnabled()
112 return wxLog::IsEnabled() && (wxLog::GetActiveTarget() != NULL
);
115 // ----------------------------------------------------------------------------
116 // implementation of Log functions
118 // NB: unfortunately we need all these distinct functions, we can't make them
119 // macros and not all compilers inline vararg functions.
120 // ----------------------------------------------------------------------------
122 // generic log function
123 void wxVLogGeneric(wxLogLevel level
, const wxChar
*szFormat
, va_list argptr
)
125 if ( IsLoggingEnabled() ) {
126 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
128 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
130 wxLog::OnLog(level
, s_szBuf
, time(NULL
));
134 void wxLogGeneric(wxLogLevel level
, const wxChar
*szFormat
, ...)
137 va_start(argptr
, szFormat
);
138 wxVLogGeneric(level
, szFormat
, argptr
);
142 #define IMPLEMENT_LOG_FUNCTION(level) \
143 void wxVLog##level(const wxChar *szFormat, va_list argptr) \
145 if ( IsLoggingEnabled() ) { \
146 wxCRIT_SECT_LOCKER(locker, gs_csLogBuf); \
148 wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr); \
150 wxLog::OnLog(wxLOG_##level, s_szBuf, time(NULL)); \
153 void wxLog##level(const wxChar *szFormat, ...) \
156 va_start(argptr, szFormat); \
157 wxVLog##level(szFormat, argptr); \
161 IMPLEMENT_LOG_FUNCTION(Error
)
162 IMPLEMENT_LOG_FUNCTION(Warning
)
163 IMPLEMENT_LOG_FUNCTION(Message
)
164 IMPLEMENT_LOG_FUNCTION(Info
)
165 IMPLEMENT_LOG_FUNCTION(Status
)
167 void wxSafeShowMessage(const wxString
& title
, const wxString
& text
)
170 ::MessageBox(NULL
, text
, title
, MB_OK
| MB_ICONSTOP
);
172 wxFprintf(stderr
, _T("%s: %s\n"), title
.c_str(), text
.c_str());
176 // fatal errors can't be suppressed nor handled by the custom log target and
177 // always terminate the program
178 void wxVLogFatalError(const wxChar
*szFormat
, va_list argptr
)
180 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
182 wxSafeShowMessage(_T("Fatal Error"), s_szBuf
);
187 void wxLogFatalError(const wxChar
*szFormat
, ...)
190 va_start(argptr
, szFormat
);
191 wxVLogFatalError(szFormat
, argptr
);
195 // same as info, but only if 'verbose' mode is on
196 void wxVLogVerbose(const wxChar
*szFormat
, va_list argptr
)
198 if ( IsLoggingEnabled() ) {
199 wxLog
*pLog
= wxLog::GetActiveTarget();
200 if ( pLog
!= NULL
&& pLog
->GetVerbose() ) {
201 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
203 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
205 wxLog::OnLog(wxLOG_Info
, s_szBuf
, time(NULL
));
210 void wxLogVerbose(const wxChar
*szFormat
, ...)
213 va_start(argptr
, szFormat
);
214 wxVLogVerbose(szFormat
, argptr
);
220 #define IMPLEMENT_LOG_DEBUG_FUNCTION(level) \
221 void wxVLog##level(const wxChar *szFormat, va_list argptr) \
223 if ( IsLoggingEnabled() ) { \
224 wxCRIT_SECT_LOCKER(locker, gs_csLogBuf); \
226 wxVsnprintf(s_szBuf, s_szBufSize, szFormat, argptr); \
228 wxLog::OnLog(wxLOG_##level, s_szBuf, time(NULL)); \
231 void wxLog##level(const wxChar *szFormat, ...) \
234 va_start(argptr, szFormat); \
235 wxVLog##level(szFormat, argptr); \
239 void wxVLogTrace(const wxChar
*mask
, const wxChar
*szFormat
, va_list argptr
)
241 if ( IsLoggingEnabled() && wxLog::IsAllowedTraceMask(mask
) ) {
242 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
245 size_t len
= s_szBufSize
;
246 wxStrncpy(s_szBuf
, _T("("), len
);
247 len
-= 1; // strlen("(")
249 wxStrncat(p
, mask
, len
);
250 size_t lenMask
= wxStrlen(mask
);
254 wxStrncat(p
, _T(") "), len
);
258 wxVsnprintf(p
, len
, szFormat
, argptr
);
260 wxLog::OnLog(wxLOG_Trace
, s_szBuf
, time(NULL
));
264 void wxLogTrace(const wxChar
*mask
, const wxChar
*szFormat
, ...)
267 va_start(argptr
, szFormat
);
268 wxVLogTrace(mask
, szFormat
, argptr
);
272 void wxVLogTrace(wxTraceMask mask
, const wxChar
*szFormat
, va_list argptr
)
274 // we check that all of mask bits are set in the current mask, so
275 // that wxLogTrace(wxTraceRefCount | wxTraceOle) will only do something
276 // if both bits are set.
277 if ( IsLoggingEnabled() && ((wxLog::GetTraceMask() & mask
) == mask
) ) {
278 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
280 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
282 wxLog::OnLog(wxLOG_Trace
, s_szBuf
, time(NULL
));
286 void wxLogTrace(wxTraceMask mask
, const wxChar
*szFormat
, ...)
289 va_start(argptr
, szFormat
);
290 wxVLogTrace(mask
, szFormat
, argptr
);
295 #define IMPLEMENT_LOG_DEBUG_FUNCTION(level)
298 IMPLEMENT_LOG_DEBUG_FUNCTION(Debug
)
299 IMPLEMENT_LOG_DEBUG_FUNCTION(Trace
)
301 // wxLogSysError: one uses the last error code, for other you must give it
304 // common part of both wxLogSysError
305 void wxLogSysErrorHelper(long lErrCode
)
307 wxChar szErrMsg
[LOG_BUFFER_SIZE
/ 2];
308 wxSnprintf(szErrMsg
, WXSIZEOF(szErrMsg
),
309 _(" (error %ld: %s)"), lErrCode
, wxSysErrorMsg(lErrCode
));
310 wxStrncat(s_szBuf
, szErrMsg
, s_szBufSize
- wxStrlen(s_szBuf
));
312 wxLog::OnLog(wxLOG_Error
, s_szBuf
, time(NULL
));
315 void WXDLLEXPORT
wxVLogSysError(const wxChar
*szFormat
, va_list argptr
)
317 if ( IsLoggingEnabled() ) {
318 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
320 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
322 wxLogSysErrorHelper(wxSysErrorCode());
326 void WXDLLEXPORT
wxLogSysError(const wxChar
*szFormat
, ...)
329 va_start(argptr
, szFormat
);
330 wxVLogSysError(szFormat
, argptr
);
334 void WXDLLEXPORT
wxVLogSysError(long lErrCode
, const wxChar
*szFormat
, va_list argptr
)
336 if ( IsLoggingEnabled() ) {
337 wxCRIT_SECT_LOCKER(locker
, gs_csLogBuf
);
339 wxVsnprintf(s_szBuf
, s_szBufSize
, szFormat
, argptr
);
341 wxLogSysErrorHelper(lErrCode
);
345 void WXDLLEXPORT
wxLogSysError(long lErrCode
, const wxChar
*szFormat
, ...)
348 va_start(argptr
, szFormat
);
349 wxVLogSysError(lErrCode
, szFormat
, argptr
);
353 // ----------------------------------------------------------------------------
354 // wxLog class implementation
355 // ----------------------------------------------------------------------------
361 wxChar
*wxLog::SetLogBuffer( wxChar
*buf
, size_t size
)
363 wxChar
*oldbuf
= s_szBuf
;
367 s_szBuf
= s_szBufStatic
;
368 s_szBufSize
= WXSIZEOF( s_szBufStatic
);
376 return (oldbuf
== s_szBufStatic
) ? 0 : oldbuf
;
379 wxLog
*wxLog::GetActiveTarget()
381 if ( ms_bAutoCreate
&& ms_pLogger
== NULL
) {
382 // prevent infinite recursion if someone calls wxLogXXX() from
383 // wxApp::CreateLogTarget()
384 static bool s_bInGetActiveTarget
= FALSE
;
385 if ( !s_bInGetActiveTarget
) {
386 s_bInGetActiveTarget
= TRUE
;
388 // ask the application to create a log target for us
389 if ( wxTheApp
!= NULL
)
390 ms_pLogger
= wxTheApp
->CreateLogTarget();
392 ms_pLogger
= new wxLogStderr
;
394 s_bInGetActiveTarget
= FALSE
;
396 // do nothing if it fails - what can we do?
403 wxLog
*wxLog::SetActiveTarget(wxLog
*pLogger
)
405 if ( ms_pLogger
!= NULL
) {
406 // flush the old messages before changing because otherwise they might
407 // get lost later if this target is not restored
411 wxLog
*pOldLogger
= ms_pLogger
;
412 ms_pLogger
= pLogger
;
417 void wxLog::DontCreateOnDemand()
419 ms_bAutoCreate
= FALSE
;
421 // this is usually called at the end of the program and we assume that it
422 // is *always* called at the end - so we free memory here to avoid false
423 // memory leak reports from wxWin memory tracking code
427 void wxLog::RemoveTraceMask(const wxString
& str
)
429 int index
= ms_aTraceMasks
.Index(str
);
430 if ( index
!= wxNOT_FOUND
)
431 ms_aTraceMasks
.Remove((size_t)index
);
434 void wxLog::ClearTraceMasks()
436 ms_aTraceMasks
.Clear();
439 void wxLog::TimeStamp(wxString
*str
)
445 (void)time(&timeNow
);
446 wxStrftime(buf
, WXSIZEOF(buf
), ms_timestamp
, localtime(&timeNow
));
449 *str
<< buf
<< wxT(": ");
453 void wxLog::DoLog(wxLogLevel level
, const wxChar
*szString
, time_t t
)
456 case wxLOG_FatalError
:
457 DoLogString(wxString(_("Fatal error: ")) + szString
, t
);
458 DoLogString(_("Program aborted."), t
);
464 DoLogString(wxString(_("Error: ")) + szString
, t
);
468 DoLogString(wxString(_("Warning: ")) + szString
, t
);
475 default: // log unknown log levels too
476 DoLogString(szString
, t
);
483 wxString msg
= level
== wxLOG_Trace
? wxT("Trace: ")
493 void wxLog::DoLogString(const wxChar
*WXUNUSED(szString
), time_t WXUNUSED(t
))
495 wxFAIL_MSG(wxT("DoLogString must be overriden if it's called."));
500 // nothing to do here
503 // ----------------------------------------------------------------------------
504 // wxLogStderr class implementation
505 // ----------------------------------------------------------------------------
507 wxLogStderr::wxLogStderr(FILE *fp
)
515 #if defined(__WXMAC__) && !defined(__DARWIN__) && defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
517 // MetroNub stuff doesn't seem to work in CodeWarrior 5.3 Carbon builds...
519 #ifndef __MetroNubUtils__
520 #include "MetroNubUtils.h"
539 #if TARGET_API_MAC_CARBON
541 #include <CodeFragments.h>
544 CallUniversalProc(UniversalProcPtr theProcPtr
, ProcInfoType procInfo
, ...);
546 ProcPtr gCallUniversalProc_Proc
= NULL
;
550 static MetroNubUserEntryBlock
* gMetroNubEntry
= NULL
;
552 static long fRunOnce
= false;
554 Boolean
IsCompatibleVersion(short inVersion
);
556 /* ---------------------------------------------------------------------------
558 --------------------------------------------------------------------------- */
560 Boolean
IsCompatibleVersion(short inVersion
)
562 Boolean result
= false;
566 MetroNubUserEntryBlock
* block
= (MetroNubUserEntryBlock
*)result
;
568 result
= (inVersion
<= block
->apiHiVersion
);
574 /* ---------------------------------------------------------------------------
576 --------------------------------------------------------------------------- */
578 Boolean
IsMetroNubInstalled()
585 gMetroNubEntry
= NULL
;
587 if (Gestalt(gestaltSystemVersion
, &value
) == noErr
&& value
< 0x1000)
589 /* look for MetroNub's Gestalt selector */
590 if (Gestalt(kMetroNubUserSignature
, &result
) == noErr
)
593 #if TARGET_API_MAC_CARBON
594 if (gCallUniversalProc_Proc
== NULL
)
596 CFragConnectionID connectionID
;
599 ProcPtr symbolAddress
;
601 CFragSymbolClass symbolClass
;
603 symbolAddress
= NULL
;
604 err
= GetSharedLibrary("\pInterfaceLib", kPowerPCCFragArch
, kFindCFrag
,
605 &connectionID
, &mainAddress
, errorString
);
609 gCallUniversalProc_Proc
= NULL
;
613 err
= FindSymbol(connectionID
, "\pCallUniversalProc",
614 (Ptr
*) &gCallUniversalProc_Proc
, &symbolClass
);
618 gCallUniversalProc_Proc
= NULL
;
625 MetroNubUserEntryBlock
* block
= (MetroNubUserEntryBlock
*)result
;
627 /* make sure the version of the API is compatible */
628 if (block
->apiLowVersion
<= kMetroNubUserAPIVersion
&&
629 kMetroNubUserAPIVersion
<= block
->apiHiVersion
)
630 gMetroNubEntry
= block
; /* success! */
639 #if TARGET_API_MAC_CARBON
640 return (gMetroNubEntry
!= NULL
&& gCallUniversalProc_Proc
!= NULL
);
642 return (gMetroNubEntry
!= NULL
);
646 /* ---------------------------------------------------------------------------
647 IsMWDebuggerRunning [v1 API]
648 --------------------------------------------------------------------------- */
650 Boolean
IsMWDebuggerRunning()
652 if (IsMetroNubInstalled())
653 return CallIsDebuggerRunningProc(gMetroNubEntry
->isDebuggerRunning
);
658 /* ---------------------------------------------------------------------------
659 AmIBeingMWDebugged [v1 API]
660 --------------------------------------------------------------------------- */
662 Boolean
AmIBeingMWDebugged()
664 if (IsMetroNubInstalled())
665 return CallAmIBeingDebuggedProc(gMetroNubEntry
->amIBeingDebugged
);
670 /* ---------------------------------------------------------------------------
671 UserSetWatchPoint [v2 API]
672 --------------------------------------------------------------------------- */
674 OSErr
UserSetWatchPoint (Ptr address
, long length
, WatchPointIDT
* watchPointID
)
676 if (IsMetroNubInstalled() && IsCompatibleVersion(kMetroNubUserAPIVersion
))
677 return CallUserSetWatchPointProc(gMetroNubEntry
->userSetWatchPoint
,
678 address
, length
, watchPointID
);
680 return errProcessIsNotClient
;
683 /* ---------------------------------------------------------------------------
684 ClearWatchPoint [v2 API]
685 --------------------------------------------------------------------------- */
687 OSErr
ClearWatchPoint (WatchPointIDT watchPointID
)
689 if (IsMetroNubInstalled() && IsCompatibleVersion(kMetroNubUserAPIVersion
))
690 return CallClearWatchPointProc(gMetroNubEntry
->clearWatchPoint
, watchPointID
);
692 return errProcessIsNotClient
;
699 #endif // defined(__WXMAC__) && !defined(__DARWIN__) && (__MWERKS__ >= 0x2400)
701 void wxLogStderr::DoLogString(const wxChar
*szString
, time_t WXUNUSED(t
))
707 fputs(str
.mb_str(), m_fp
);
708 fputc(_T('\n'), m_fp
);
711 // under Windows, programs usually don't have stderr at all, so show the
712 // messages also under debugger (unless it's a console program which does
713 // have stderr or unless this is a file logger which doesn't use stderr at
715 #if defined(__WXMSW__) && wxUSE_GUI && !defined(__WXMICROWIN__)
716 if ( m_fp
== stderr
)
719 OutputDebugString(str
.c_str());
723 #if defined(__WXMAC__) && !defined(__DARWIN__) && wxUSE_GUI
725 wxString output
= str
+ wxT(";g") ;
726 wxMacStringToPascal( output
.c_str() , pstr
) ;
728 Boolean running
= false ;
730 #if defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
732 if ( IsMWDebuggerRunning() && AmIBeingMWDebugged() )
750 // ----------------------------------------------------------------------------
751 // wxLogStream implementation
752 // ----------------------------------------------------------------------------
754 #if wxUSE_STD_IOSTREAM
755 #include "wx/ioswrap.h"
756 wxLogStream::wxLogStream(wxSTD ostream
*ostr
)
759 m_ostr
= &wxSTD cerr
;
764 void wxLogStream::DoLogString(const wxChar
*szString
, time_t WXUNUSED(t
))
768 (*m_ostr
) << str
<< wxConvertWX2MB(szString
) << wxSTD endl
;
770 #endif // wxUSE_STD_IOSTREAM
772 // ----------------------------------------------------------------------------
774 // ----------------------------------------------------------------------------
776 wxLogChain::wxLogChain(wxLog
*logger
)
778 m_bPassMessages
= TRUE
;
781 m_logOld
= wxLog::SetActiveTarget(this);
784 wxLogChain::~wxLogChain()
788 if ( m_logNew
!= this )
792 void wxLogChain::SetLog(wxLog
*logger
)
794 if ( m_logNew
!= this )
800 void wxLogChain::Flush()
805 // be careful to avoid infinite recursion
806 if ( m_logNew
&& m_logNew
!= this )
810 void wxLogChain::DoLog(wxLogLevel level
, const wxChar
*szString
, time_t t
)
812 // let the previous logger show it
813 if ( m_logOld
&& IsPassingMessages() )
815 // bogus cast just to access protected DoLog
816 ((wxLogChain
*)m_logOld
)->DoLog(level
, szString
, t
);
819 if ( m_logNew
&& m_logNew
!= this )
822 ((wxLogChain
*)m_logNew
)->DoLog(level
, szString
, t
);
826 // ----------------------------------------------------------------------------
828 // ----------------------------------------------------------------------------
831 // "'this' : used in base member initializer list" - so what?
832 #pragma warning(disable:4355)
835 wxLogPassThrough::wxLogPassThrough()
841 #pragma warning(default:4355)
844 // ============================================================================
845 // Global functions/variables
846 // ============================================================================
848 // ----------------------------------------------------------------------------
850 // ----------------------------------------------------------------------------
852 wxLog
*wxLog::ms_pLogger
= (wxLog
*)NULL
;
853 bool wxLog::ms_doLog
= TRUE
;
854 bool wxLog::ms_bAutoCreate
= TRUE
;
855 bool wxLog::ms_bVerbose
= FALSE
;
857 wxLogLevel
wxLog::ms_logLevel
= wxLOG_Max
; // log everything by default
859 size_t wxLog::ms_suspendCount
= 0;
862 const wxChar
*wxLog::ms_timestamp
= wxT("%X"); // time only, no date
864 const wxChar
*wxLog::ms_timestamp
= NULL
; // save space
867 wxTraceMask
wxLog::ms_ulTraceMask
= (wxTraceMask
)0;
868 wxArrayString
wxLog::ms_aTraceMasks
;
870 // ----------------------------------------------------------------------------
871 // stdout error logging helper
872 // ----------------------------------------------------------------------------
874 // helper function: wraps the message and justifies it under given position
875 // (looks more pretty on the terminal). Also adds newline at the end.
877 // TODO this is now disabled until I find a portable way of determining the
878 // terminal window size (ok, I found it but does anybody really cares?)
879 #ifdef LOG_PRETTY_WRAP
880 static void wxLogWrap(FILE *f
, const char *pszPrefix
, const char *psz
)
882 size_t nMax
= 80; // FIXME
883 size_t nStart
= strlen(pszPrefix
);
887 while ( *psz
!= '\0' ) {
888 for ( n
= nStart
; (n
< nMax
) && (*psz
!= '\0'); n
++ )
892 if ( *psz
!= '\0' ) {
894 for ( n
= 0; n
< nStart
; n
++ )
897 // as we wrapped, squeeze all white space
898 while ( isspace(*psz
) )
905 #endif //LOG_PRETTY_WRAP
907 // ----------------------------------------------------------------------------
908 // error code/error message retrieval functions
909 // ----------------------------------------------------------------------------
911 // get error code from syste
912 unsigned long wxSysErrorCode()
914 #if defined(__WXMSW__) && !defined(__WXMICROWIN__)
916 return ::GetLastError();
918 // TODO what to do on Windows 3.1?
926 // get error message from system
927 const wxChar
*wxSysErrorMsg(unsigned long nErrCode
)
930 nErrCode
= wxSysErrorCode();
932 #if defined(__WXMSW__) && !defined(__WXMICROWIN__)
934 static wxChar s_szBuf
[LOG_BUFFER_SIZE
/ 2];
936 // get error message from system
938 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
,
940 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
),
944 // copy it to our buffer and free memory
945 if( lpMsgBuf
!= 0 ) {
946 wxStrncpy(s_szBuf
, (const wxChar
*)lpMsgBuf
, WXSIZEOF(s_szBuf
) - 1);
947 s_szBuf
[WXSIZEOF(s_szBuf
) - 1] = wxT('\0');
951 // returned string is capitalized and ended with '\r\n' - bad
952 s_szBuf
[0] = (wxChar
)wxTolower(s_szBuf
[0]);
953 size_t len
= wxStrlen(s_szBuf
);
956 if ( s_szBuf
[len
- 2] == wxT('\r') )
957 s_szBuf
[len
- 2] = wxT('\0');
961 s_szBuf
[0] = wxT('\0');
971 static wxChar s_szBuf
[LOG_BUFFER_SIZE
/ 2];
972 wxConvCurrent
->MB2WC(s_szBuf
, strerror(nErrCode
), WXSIZEOF(s_szBuf
) -1);
975 return strerror((int)nErrCode
);