Allow using milliseconds in wxLog timestamp.
Use wxDateTime::UNow() instead of time() and wxDateTime::Format() instead of localtime() to make it possible to use "%l" specifier in wxLog time stamp. Closes #13059. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -451,6 +451,7 @@ All:
|
|||||||
- Added wxStack<> template class.
|
- Added wxStack<> template class.
|
||||||
- Added precision parameter to wxString::From[C]Double().
|
- Added precision parameter to wxString::From[C]Double().
|
||||||
- Added wxThread::Wait() and Delete() "wait mode" parameter (Catalin Raceanu).
|
- Added wxThread::Wait() and Delete() "wait mode" parameter (Catalin Raceanu).
|
||||||
|
- Allow showing milliseconds in wxLog time stamps (tan).
|
||||||
|
|
||||||
Unix:
|
Unix:
|
||||||
|
|
||||||
|
@@ -676,16 +676,8 @@ void wxLog::TimeStamp(wxString *str)
|
|||||||
#if wxUSE_DATETIME
|
#if wxUSE_DATETIME
|
||||||
if ( !ms_timestamp.empty() )
|
if ( !ms_timestamp.empty() )
|
||||||
{
|
{
|
||||||
wxChar buf[256];
|
*str = wxDateTime::UNow().Format(ms_timestamp);
|
||||||
time_t timeNow;
|
*str += wxS(": ");
|
||||||
(void)time(&timeNow);
|
|
||||||
|
|
||||||
struct tm tm;
|
|
||||||
wxStrftime(buf, WXSIZEOF(buf),
|
|
||||||
ms_timestamp, wxLocaltime_r(&timeNow, &tm));
|
|
||||||
|
|
||||||
str->Empty();
|
|
||||||
*str << buf << wxS(": ");
|
|
||||||
}
|
}
|
||||||
#endif // wxUSE_DATETIME
|
#endif // wxUSE_DATETIME
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user