The code that highlights dates for log lines is pretty bad:
|
if let Some((date, rest)) = l.splitn(2, ' ').collect_tuple() { |
|
// This is not a good way to identify dates; the length can vary by system. |
|
// TODO: find a better way to identify dates |
|
if date.len() != 25 { |
|
return Line::from(l.as_str()); |
|
} |
|
Line::from(vec![Span::styled(date, Style::default().fg(Color::DarkGray)), Span::raw(" "), Span::raw(rest)]) |
It assumes that dates are in a certain format (no spaces) and length (25 chars). This works on my machine ™ but won't work on everyone's. Figure out a better way to do this.
The code that highlights dates for log lines is pretty bad:
systemctl-tui/src/components/home.rs
Lines 884 to 890 in e2bc8fb
It assumes that dates are in a certain format (no spaces) and length (25 chars). This works on my machine ™ but won't work on everyone's. Figure out a better way to do this.