Really support milliseconds in wxLog

Although this was supposed to work, specifying "%l" in wxLog time stamp
format actually didn't because wxLog timestamps were stored as seconds.

Fix this by storing them as milliseconds and add a simple test (not
executed by default) showing that "%l" works correctly now.

Still keep the old wxLogRecordInfo::timestamp field for compatibility,
as it was documented.

See #13059.
This commit is contained in:
Vadim Zeitlin
2021-01-13 23:50:44 +01:00
parent 89bc7b522f
commit e6cedf6649
6 changed files with 99 additions and 11 deletions

View File

@@ -471,7 +471,7 @@ MyFrame::DoLogRecord(wxLogLevel level,
DoLogLine
(
m_txtctrl,
wxDateTime(info.timestamp).FormatISOTime(),
wxDateTime(wxLongLong(info.timestampMS)).FormatISOTime(),
info.threadId == wxThread::GetMainId()
? wxString("main")
: wxString::Format("%lx", info.threadId),