Page MenuHomePhabricator

Correct time output in logging
Closed, ResolvedPublic


mbilog.cpp was changed in the past to output the absolute date/time. This introduced an additional newline in the output which breaks readability. Output now looks like

[Fri Apr 16 15:43:22 2010
0.260 ] In c'tor of PSelectForOneReferenceQuery
[Fri Apr 16 15:43:22 2010
0.260 ] In c'tor of PSelectForOneReferenceInNtoMQuery
[Fri Apr 16 15:43:22 2010
0.260 ] In c'tor of PSelectForPresentNtoMReferenceQuery

The newline is introduced by the call to ctime(..), which return it by definition.

I would remove this extra newline and replace it with a space character (to separate absolute time from relative time since thread start).

I already verified that my change changes the output to

[Fri Apr 16 16:19:46 2010 0.230] Connecting to Database
[Fri Apr 16 16:19:46 2010 0.260] Connecting finished status : 1

In T3684 I suggested a review to define some tests cases for logging.

Event Timeline

[SVN revision 22277]
FIX (#3685): remove line break after output of time stamp

[SVN revision 22288]
FIX (#3685): fix Windows compilation

[SVN revision 22295]
COMP (#3685): fix syntax error

Finally fixed. I'll setup some Windows virtual machine for personal testing...

[SVN revision 22323]
FIX (#3685): Insert newline after first date/time under Windows.

[SVN revision 22368]
FIX (#3685): Use same format under Linux

Merging "Utilities" component into "Other"

Resetting all bugs without active assignee flag to "CONFIRMED". Change status to IN_PROGRESS if you are working on it.