Closed manio closed 5 years ago
4d9de6c9b699356a8e7236c8d3b24fad94618858 instead allows you to specify a FixedOffset
to be used for logging (default is still UTC). You can now use any timezone (including one derived from chrono::offset::Local
) for logging.
Maybe I misunderstand something but I don't see how is it possible to use Local
. Config expects a FixedOffset
. Local
doesn't have fix()
method so I think the only possible solution is to construct the current date with Local
and then find some way to get the FixedOffset
from the date. Even if I do that then I'll get a FixedOffset which is relevant to the time the current date was crated. If an application using simplelog.rs stays running during the night the timezone shifts to daylight saving time then the time in the logs would be wrong. Perhaps Config
should get a &Timezone
or Box<Timezone>
?
Of course, I forget about DST... I will check this...
Perhaps
Config
should get a&Timezone
orBox<Timezone>
?
I am afraid this is not possible. Timezone is not object-safe, so I am sure, how I could store it in the config.
Fixed via a6fd9a240c36e26fc9ca0ceb07cec1b52359c382.
Will be in v0.7
Hi Victor, I think it is sometimes desirable to log times using a local timezone instead of UTC: https://github.com/Drakulix/simplelog.rs/blob/9cc5b7e87d964658d08a17a075f0801bd98ba629/src/loggers/logging.rs#L43
Can you make it configurable somehow?