#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;
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