Opened 5 years ago

Closed 3 years ago

#8839 closed Feature Requests (fixed)

Default timestamp format

Reported by: lcarreon@… Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.54.0 Severity: Cosmetic
Keywords: Cc:


The default timestamp format should be:

%Y-%m-%d %H:%M:%S.%f

instead of:

%Y-%b-%d %H:%M:%S.%f

just in case a sorting of the log records according to timestamp is needed. (For example when log records get out of order due to threading.)

Attachments (0)

Change History (4)

comment:1 Changed 5 years ago by Andrey Semashev

What do you mean by "default timestamp format"? There is no default in log::expressions::format_date_time placeholder. If you format timestamps with the log::expressions::attr placeholder then formatting is performed by the regular operator<< for timestamps, which is provided by Boost.DateTime?. I don't think it is reasonable to change that operator behavior.

comment:2 Changed 5 years ago by lcarreon@…

What I mean is when you use %TimeStamp?% in a format string, it should format the timestamp using the format %y-%m-%d %M:%H:%S.%f.

comment:3 Changed 5 years ago by Andrey Semashev

When no formatter factory is registered for the "TimeStamp?" attribute, the default factory will create a formatter similar to the log::expressions::attr placeholder. This is because the library has no knowledge of this attribute and does no special treatment. You have to register your own factory to change that.

I can try to change the default factory so that the generated formatter behaves differently for different types.

comment:4 Changed 3 years ago by Andrey Semashev

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Andrey Semashev.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.