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:
@@ -454,4 +454,16 @@ void macroCompilabilityTest()
|
||||
wxLogDebug("hello debug %d", 42);
|
||||
}
|
||||
|
||||
// This allows to check wxLogTrace() interactively by running this test with
|
||||
// WXTRACE=logtest.
|
||||
TEST_CASE("wxLog::Trace", "[log][.]")
|
||||
{
|
||||
// Running this test without setting WXTRACE is useless.
|
||||
REQUIRE( wxGetEnv("WXTRACE", NULL) );
|
||||
|
||||
wxLogTrace("logtest", "Starting test");
|
||||
wxMilliSleep(250);
|
||||
wxLogTrace("logtest", "Ending test 1/4s later");
|
||||
}
|
||||
|
||||
#endif // wxUSE_LOG
|
||||
|
Reference in New Issue
Block a user