void Error::TraceWrite(const TCHAR * bufp, va_list args) { // wxWidgets doesn't expect newlines in the string, but Camelot source provides them. So we print each bit // separately #if 1 // replace \n by a space - the real solution is to remove the \n from all the trace statements (yawn) TCHAR buf[MAXERRORFORMATLENGTH]; camStrncpy(buf, bufp, MAXERRORFORMATLENGTH); buf[MAXERRORFORMATLENGTH-1]=0; TCHAR * b=buf; do { if (*b == '\n') *b=' '; } while(*b++); wxVLogDebug(buf, args); #else // this way is bad as it doesn't work with args either side of the newline TCHAR * newline; do { newline = camStrchr(bufp, _T('\n')); if (newline) *newline++=0; // We really should pass only the args before the newline here, but... wxVLogDebug(bufp, args); bufp=newline; } while (bufp && *bufp); #endif }
void Logging::logDebug( const char *szFormat, ... ) const { wxLog *pLogBak = wxLog::SetActiveTarget(m_pLogger); va_list marker; va_start( marker, szFormat ); wxVLogDebug( wxConvertMB2WX(szFormat), marker ); va_end( marker ); wxLog::SetActiveTarget(pLogBak); }
void Logging::logTrace( const char *szFormat, ... ) const { wxLog *pLogBak = wxLog::SetActiveTarget(m_pLogger); va_list marker; va_start( marker, szFormat ); // wxVLogTrace( wxConvertMB2WX(szFormat), marker ); @todo FIXME modified interface in wx2.5 and superior. wxVLogDebug( wxConvertMB2WX(szFormat), marker ); va_end( marker ); wxLog::SetActiveTarget(pLogBak); }