dependencies: switch from chrono to jiff

We weren't really using `chrono` for anything other than getting the
current time and formatting it for logs.

Unfortunately, this doesn't quite get us to a point where `chrono`
can be removed. From what I can tell, we're still bringing it via
[`tracing-subscriber`](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/)
and
[`quick-junit`](https://docs.rs/quick-junit/latest/quick_junit/).
`tracing-subscriber` does have an
[issue open about Jiff](https://github.com/tokio-rs/tracing/discussions/3128),
but there's no movement on it.

Normally I'd suggest holding off on this since it doesn't get us all of
the way there and it would be better to avoid bringing in two datetime
libraries, but we are, it appears, already there. In particular,
`env_logger` brings in Jiff. So this PR doesn't really make anything
worse, but it does bring us closer to an all-Jiff world.
This commit is contained in:
Andrew Gallant 2025-04-13 18:17:35 -04:00 committed by Andrew Gallant
parent f05b2d3673
commit 1d49e71ddd
7 changed files with 31 additions and 14 deletions

View file

@ -32,7 +32,6 @@ ruff_text_size = { workspace = true }
aho-corasick = { workspace = true }
anyhow = { workspace = true }
bitflags = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true, features = ["derive", "string"], optional = true }
colored = { workspace = true }
fern = { workspace = true }
@ -43,6 +42,7 @@ is-macro = { workspace = true }
is-wsl = { workspace = true }
itertools = { workspace = true }
libcst = { workspace = true }
jiff = { workspace = true }
log = { workspace = true }
memchr = { workspace = true }
natord = { workspace = true }

View file

@ -85,8 +85,8 @@ macro_rules! notify_user {
($($arg:tt)*) => {
println!(
"[{}] {}",
chrono::Local::now()
.format("%H:%M:%S %p")
jiff::Zoned::now()
.strftime("%H:%M:%S %p")
.to_string()
.dimmed(),
format_args!($($arg)*)
@ -142,7 +142,7 @@ pub fn set_up_logging(level: LogLevel) -> Result<()> {
Level::Info | Level::Debug | Level::Trace => {
out.finish(format_args!(
"{}[{}][{}] {}",
chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"),
jiff::Zoned::now().strftime("[%Y-%m-%d][%H:%M:%S]"),
record.target(),
record.level(),
message