Skip to content

feat(example): show milliseconds since logger init#407

Merged
epage merged 1 commit into
rust-cli:mainfrom
SAY-5:feat/example-millis-since-init
May 21, 2026
Merged

feat(example): show milliseconds since logger init#407
epage merged 1 commit into
rust-cli:mainfrom
SAY-5:feat/example-millis-since-init

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 13, 2026

Adds an example that captures Instant::now() and uses it inside the custom format closure to print elapsed milliseconds, matching the approach @vigna confirmed in #355. Closes #355.

Comment thread examples/millis_since_init.rs
Comment thread examples/millis_since_init.rs
Comment thread examples/millis_since_init.rs
@SAY-5 SAY-5 force-pushed the feat/example-millis-since-init branch from 93326dd to 481f874 Compare May 18, 2026 23:13
@SAY-5 SAY-5 force-pushed the feat/example-millis-since-init branch from 481f874 to 4054e9d Compare May 18, 2026 23:28
@SAY-5
Copy link
Copy Markdown
Contributor Author

SAY-5 commented May 18, 2026

Added a short sleep between the two log lines so the elapsed time is actually visible (now reads ~250 ms on the second record). Kept the block doc-comment to match the other examples. Happy to fold this into custom_format.rs if you'd prefer one example, though that one is gated behind the color+humantime features while this one stands alone, so I left them separate for now.

@epage epage merged commit 1499f34 into rust-cli:main May 21, 2026
15 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.

Add example for millisecond since init

2 participants