Updates:
Summary: When logging messages through stdout timestamps are not
accurate
Comment #5 on issue 456 by pekka.klarck: When logging messages through
stdout timestamps are not accurate
http://code.google.com/p/robotframework/issues/detail?id=456
We have now implemented public logging API (issue 339) and messages logged
through it get accurate timestamps. It would be nice to get correct
timestamps also when logging through the standard output, though, to make
this functionality available for Java based libraries. We have, at least,
following possibilities:
1) Enhance the stdout (and stderr) capturing logic so that messages written
to the stdout automatically get correct timestamps. I don't know how easy
or hard that would be, but it's certain that it's not a trivial task. To
support also Java libraries, we needed to implement this both using Python
and Java APIs. Even then this wouldn't support the remote interface.
2) Allow embedding the timestamps to the messages written to the stdout. We
could, for example, support format such as `*INFO:2010-05-09 12:51:01.123*
The message`. This approach has several benefits: it's easy to implement,
works the same way with Python and Java libs, and supports even messages
got through the remote interface.
3) Implement a Java API that calls the new Python logging API though Jython
and add it to Java Lib Core. That would add allow using accurate timestamps
from Java but not through the remote interface.
Personally I'm in favor of implementing option 2) because it's easiest and
also supports the remote interface. Implementing 3) might be a good idea
separately anyway.