Skip to content

Timestamp anomaly in Poco::Logger on WindowsCE #741

@bachp

Description

@bachp

After changing the system time on Windows CE the log message time behaves oddly.

POCO Log Timestamp                  System Time
2014.01.01 00:03:00,294 : SysTime:  0: 3: 0:294: # Time stamps equal
2014.01.01 00:03:00,341 : SysTime:  0: 3: 0:341:
2014.01.01 00:03:00,366 : SysTime:  0: 3: 0:366:
# Change date:
# After date change time stamps are different by a few milliseconds
2015.03.10 00:03:00,426 : SysTime:  0: 3: 0: 21: 
2015.03.10 00:03:00,451 : SysTime:  0: 3: 0: 46: 
2015.03.10 00:03:00,502 : SysTime:  0: 3: 0: 97:
2015.03.10 00:03:00,534 : SysTime:  0: 3: 0:129:
2015.03.10 00:03:00,581 : SysTime:  0: 3: 0:176:
2015.03.10 00:03:00,613 : SysTime:  0: 3: 0:208:
2015.03.10 00:03:00,661 : SysTime:  0: 3: 0:256:
2015.03.10 00:03:00,686 : SysTime:  0: 3: 0:281:
2015.03.10 00:03:00,732 : SysTime:  0: 3: 0:327:
2015.03.10 00:03:00,757 : SysTime:  0: 3: 0:352:
2015.03.10 00:03:00,801 : SysTime:  0: 3: 0:396:
2015.03.10 00:03:00,833 : SysTime:  0: 3: 0:428:
2015.03.10 00:03:00,881 : SysTime:  0: 3: 0:476:
2015.03.10 00:03:00,913 : SysTime:  0: 3: 0:508:
2015.03.10 00:03:00,962 : SysTime:  0: 3: 0:557:
2015.03.10 00:03:00,987 : SysTime:  0: 3: 0:582: # Millisecond overflow doesn't trigger a change in seconds in the POCO time stamp...
2015.03.10 00:03:00,032 : SysTime:  0: 3: 0:627:
2015.03.10 00:03:00,057 : SysTime:  0: 3: 0:652:
2015.03.10 00:03:00,101 : SysTime:  0: 3: 0:696:
2015.03.10 00:03:00,133 : SysTime:  0: 3: 0:728:
2015.03.10 00:03:00,181 : SysTime:  0: 3: 0:776:
2015.03.10 00:03:00,213 : SysTime:  0: 3: 0:808:
2015.03.10 00:03:00,261 : SysTime:  0: 3: 0:856:
2015.03.10 00:03:00,286 : SysTime:  0: 3: 0:881:
2015.03.10 00:03:00,331 : SysTime:  0: 3: 0:926:
2015.03.10 00:03:00,356 : SysTime:  0: 3: 0:951:
2015.03.10 00:03:00,401 : SysTime:  0: 3: 0:996: # Millisecond overflow in system time does lead to second increase in POCO timestamp.
2015.03.10 00:03:01,434 : SysTime:  0: 3: 1: 29: 
2015.03.10 00:03:01,482 : SysTime:  0: 3: 1: 77:
2015.03.10 00:03:01,514 : SysTime:  0: 3: 1:109:

It looks like the microseconds in the POCO Time stamp doesn't correspond to the system time after the change. The rest (hours, minutes, seconds) seem to be correct.

The log messages were created using the following snippet:

SYSTEMTIME sSys;
GetSystemTime(&sSys);
sprintf(cc, "SysTime: %2d:%2d:%2d:%3d:", sSys.wHour,sSys.wMinute, sSys.wSecond, sSys.wMilliseconds);
CTXOTraceLog::Instance()->Trace().information(cc);

And the Log formatter used was the following:

AutoPtr<PatternFormatter> pFPattern(new PatternFormatter("%Y.%m.%d %H:%M:%S,%i : %t"));

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions