Drakulix / simplelog.rs

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

make chrono optional #109

Open jb-alvarado opened 2 years ago

jb-alvarado commented 2 years ago

This pull request is not ready to merge, is more for discussion.

Chrono has two new maintainer and in the last months there is continues developments on it. The segfault on localtime_r is fixed and there is more improvements.

The reason for make chrono optional again is, that many project rely on it, it has set_time_to_local and it has better formatting options then time.

jb-alvarado commented 1 year ago

Final chrono 0.4.20 is now out, any comments to the PR?

jb-alvarado commented 1 year ago

Hi @Drakulix, thank you for your suggestions! They really makes sense, but I'm not skilled enough to implement them. I started with:

#[derive(Debug, Clone)]
pub(crate) enum TimeFormat {
    Rfc2822,
    Rfc3339,
    #[cfg(feature = "chrono")]
    Custom(Cow<'static, str>),
    #[cfg(not(feature = "chrono"))]
    Custom(&'static [time::format_description::FormatItem<'static>]),
}

But then how to continue, I don't know.