#endif //WX_PRECOMP
#include "wx/apptrait.h"
+#include "wx/datetime.h"
#include "wx/file.h"
#include "wx/msgout.h"
#include "wx/textfile.h"
{
if ( GetRepetitionCounting() )
{
- pLogger->DoLogNumberOfRepeats();
+ DoLogNumberOfRepeats();
}
ms_prevString = szString;
ms_prevLevel = level;
}
// deprecated function
+#if WXWIN_COMPATIBILITY_2_6
+
wxChar *wxLog::SetLogBuffer(wxChar * WXUNUSED(buf), size_t WXUNUSED(size))
{
return NULL;
}
+#endif // WXWIN_COMPATIBILITY_2_6
+
wxLog *wxLog::GetActiveTarget()
{
if ( ms_bAutoCreate && ms_pLogger == NULL ) {
void wxLog::TimeStamp(wxString *str)
{
+#if wxUSE_DATETIME
if ( ms_timestamp )
{
wxChar buf[256];
time_t timeNow;
(void)time(&timeNow);
- wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow));
+
+ struct tm tm;
+ wxStrftime(buf, WXSIZEOF(buf),
+ ms_timestamp, wxLocaltime_r(&timeNow, &tm));
str->Empty();
*str << buf << wxT(": ");
}
+#endif // wxUSE_DATETIME
}
void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
TimeStamp(&str);
str << szString;
- fputs(str.mb_str(), m_fp);
- fputc(_T('\n'), m_fp);
+ wxFputs(str, m_fp);
+ wxFputc(_T('\n'), m_fp);
fflush(m_fp);
// under GUI systems such as Windows or Mac, programs usually don't have