Skip to content

Comments

Replace time crate with jiff#315

Merged
Byron merged 2 commits intomainfrom
copilot/switch-time-crate-to-jiff
Feb 6, 2026
Merged

Replace time crate with jiff#315
Byron merged 2 commits intomainfrom
copilot/switch-time-crate-to-jiff

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

Removes the time crate dependency by switching from simplelog to fern for logging, with jiff providing timestamp formatting.

Changes

  • Dependencies: Replaced simplelog with fern 0.7.1 and jiff 0.2.18
  • Logging: Custom fern::Dispatch formatter using jiff::Zoned::now() for timestamps
fern::Dispatch::new()
    .level(log::LevelFilter::Debug)
    .format(|formatter_out, log_msg, log_rec| {
        let when = jiff::Zoned::now();
        formatter_out.finish(format_args!(
            "[{} {} {}:{}] {}",
            when.strftime("%Y-%m-%d %H:%M:%S%.3f %:z"),
            log_rec.level(),
            log_rec.file().unwrap_or("<unknown>"),
            log_rec.line().unwrap_or(0),
            log_msg
        ))
    })
    .chain(log_output)
    .apply()?;

Log format remains functionally equivalent with timezone-aware timestamps.

Original prompt

Switch the time crate with jiff.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Switch the time crate with jiff Replace time crate with jiff Feb 5, 2026
Copilot AI requested a review from Byron February 5, 2026 19:45
@Byron Byron force-pushed the copilot/switch-time-crate-to-jiff branch from 79e44f0 to 981f07e Compare February 6, 2026 04:42
@Byron
Copy link
Owner

Byron commented Feb 6, 2026

Old

04:41:37 [INFO] dua options=Args {
    command: None,
    threads: 3,
    format: Metric,
    apparent_size: false,
    count_hard_links: false,
    stay_on_filesystem: false,
    ignore_dirs: [],
    input: [],
    log_file: Some(
        "/dev/stdout",
    ),
}
04:41:37 [INFO] Ignoring canonicalized {}

New

More verbose, but I think it's better suited for a log that should provide most information.

[2026-02-06 05:41:32.146 +01:00 INFO src/main.rs:55] dua options=Args {
    command: None,
    threads: 3,
    format: Metric,
    apparent_size: false,
    count_hard_links: false,
    stay_on_filesystem: false,
    ignore_dirs: [],
    input: [],
    log_file: Some(
        "/dev/stdout",
    ),
}
[2026-02-06 05:41:32.154 +01:00 INFO src/common.rs:253] Ignoring canonicalized {}

Copilot AI and others added 2 commits February 6, 2026 05:43
Note that this changes the log format from

    04:41:37 [INFO]

to

    [2026-02-06 05:41:32.146 +01:00 INFO src/main.rs:55]

Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
@Byron Byron force-pushed the copilot/switch-time-crate-to-jiff branch from 981f07e to 60812a2 Compare February 6, 2026 04:44
@Byron Byron marked this pull request as ready for review February 6, 2026 04:44
@Byron Byron merged commit 017e716 into main Feb 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants