logs-wheel 0.3.1

Rolling log files with compression
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::fmt;
use time::Date;

pub struct CompactDateFormatter(pub Date);

impl CompactDateFormatter {
    pub const LEN: usize = 8;
}

impl fmt::Display for CompactDateFormatter {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let (year, month, day) = self.0.to_calendar_date();
        f.write_fmt(format_args!("{year:04}{:02}{day:02}", month as u8))
    }
}