Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log timestamps not using local timezone #16400

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

bestgopher
Copy link
Contributor

@bestgopher bestgopher commented Aug 17, 2024

Get time offset by time crate will fail if there are mutli threads. So call config_builder.set_time_offset_to_local() is useless.

Closes #16397

after:
image

Release Notes:

  • Fixed Local Timezone not showing Zed.log

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Aug 17, 2024
@bestgopher bestgopher changed the title fix(zed): the time of log is not base on local timezone (#16397) fix(zed): The time of log is not base on local timezone (#16397) Aug 17, 2024
@bestgopher bestgopher changed the title fix(zed): The time of log is not base on local timezone (#16397) fix(zed): The time of log is not base on local timezone Aug 17, 2024
Get time offset by time crate will fail if there are mutli threads. So call `config_builder.set_time_offset_to_local()` is useless.

Closes zed-industries#16397
Signed-off-by: bestgopher <84328409@qq.com>
@maxdeviant maxdeviant changed the title fix(zed): The time of log is not base on local timezone Fix log timestamps not using local timezone Aug 17, 2024
@bestgopher
Copy link
Contributor Author

bestgopher commented Aug 17, 2024

config_builder.set_time_offset_to_local() uses UtcOffset::current_local_offset() to get local offset, but it will get Err(error::IndeterminateOffset) when there are multi-thead (time-rs/time#293, time-rs/time#296). I have debuged the fn main, I don't why there are 3 threads when main start to execute. So UtcOffset::current_local_offset() will always return Err.

@ConradIrwin
Copy link
Member

Thanks!

@ConradIrwin ConradIrwin merged commit e17a5c1 into zed-industries:main Aug 22, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the time of log is not base on local timezone
2 participants