rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

internal: Use local time when formatting logs

Open Wilfred opened this issue 1 year ago • 4 comments

When debugging rust-analyzer and looking at logs, it's much easier to read when the timestamp is in the local timezone.

Before:

2024-08-28T20:55:38.792321Z  INFO ParseQuery: invoked at R18460

After:

2024-08-28T13:55:38.792321-07:00  INFO ParseQuery: invoked at R18460

Wilfred avatar Aug 28 '24 20:08 Wilfred

It is sad to introduce a dependency just for that...

ChayimFriedman2 avatar Aug 28 '24 21:08 ChayimFriedman2

I agree, I'd rather not pull in a time library just for this

Veykril avatar Aug 29 '24 07:08 Veykril

Can we use OffsetTime (using time, which we already pull in) or SystemTime instead?

lnicola avatar Aug 29 '24 09:08 lnicola

rust-analyzer might not be able to use OffsetTime without introducing some unsafe code, but I think SystemTime might be reasonable for user-facing logs.

(I think if rust-analyzer ever used something like OpenTelemetry for emitting a bunch of traces—I want that for Reasons™—then those should be UTC via time.)

davidbarsky avatar Aug 29 '24 20:08 davidbarsky

:umbrella: The latest upstream changes (presumably #18227) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Oct 04 '24 19:10 bors

Needs a rebase @bors delegate=Wilfred

Veykril avatar Oct 14 '24 11:10 Veykril

:v: @Wilfred, you can now approve this pull request!

If @Veykril told you to "r=me" after making some further change, please make that change, then do @bors r=@Veykril

bors avatar Oct 14 '24 11:10 bors

@bors r=@Veykril

Wilfred avatar Oct 16 '24 22:10 Wilfred

:pushpin: Commit 36b9f099170a6f80b65c4d4ef54957d6005c13da has been approved by Veykril

It is now in the queue for this repository.

bors avatar Oct 16 '24 22:10 bors

:hourglass: Testing commit 36b9f099170a6f80b65c4d4ef54957d6005c13da with merge a439ed8b8a667c0420f53a2b7f116c1cc8fed4e4...

bors avatar Oct 16 '24 22:10 bors

:sunny: Test successful - checks-actions Approved by: Veykril Pushing a439ed8b8a667c0420f53a2b7f116c1cc8fed4e4 to master...

bors avatar Oct 16 '24 22:10 bors

:sunny: Test successful - checks-actions Approved by: Veykril Pushing a439ed8b8a667c0420f53a2b7f116c1cc8fed4e4 to master...

bors avatar Oct 16 '24 22:10 bors

:eyes: Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

bors avatar Oct 16 '24 22:10 bors