Drakulix / simplelog.rs

Simple Logging Facility for Rust
https://docs.rs/simplelog/
Apache License 2.0
439 stars 73 forks source link

Wrong time? #51

Closed Hultan closed 5 years ago

Hultan commented 5 years ago

I am using : simplelog = "^0.7.3" and I am getting utc(?) time in the log file. My local time (Sweden) is currently +2 hours, so every log entry in the log file is two hours off. Is this by design, or is it something that I have failed to set up correctly?

Drakulix commented 5 years ago

I am using : simplelog = "^0.7.3" and I am getting utc(?) time in the log file. My local time (Sweden) is currently +2 hours, so every log entry in the log file is two hours off. Is this by design, or is it something that I have failed to set up correctly?

UTC as default is by design (and is usually used on servers and a like), but you can use your local timezone by configuring your logger(s).

Either set a fixed offset using ConfigBuilder::set_time_offset or default to the local timezone (which will also take care of daylight savings and the like) by using ConfigBuilder::set_time_to_local.

(Feel free to reopen, if you have additional issues in regards to time logging.)

Hultan commented 5 years ago

Awesome, I had a feeling I had missed something. Thanks for this crate!