You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Launching ./target/release/noaa-apt shows this error:
❯ ./target/release/noaa-apt
thread 'main' panicked at 'Could not determine the UTC offset on this system. Possible causes are that the time crate does not implement "local_offset_at" on your system, or that you are running in a multi-threaded environment and the time crate is returning "None" from "local_offset_at" to avoid unsafe behaviour. See the time crate's documentation for more information. (https://time-rs.github.io/internal-api/time/index.html#feature-flags): IndeterminateOffset', /Users/arun/.cargo/registry/src/github.com-1ecc6299db9ec823/simple_logger-1.16.0/src/lib.rs:409:85
stack backtrace:
0: rust_begin_unwind
at /rustc/404c8471aba60c2d837fa728e7c729a0f52d5830/library/std/src/panicking.rs:498:5
1: core::panicking::panic_fmt
at /rustc/404c8471aba60c2d837fa728e7c729a0f52d5830/library/core/src/panicking.rs:107:14
2: core::result::unwrap_failed
at /rustc/404c8471aba60c2d837fa728e7c729a0f52d5830/library/core/src/result.rs:1661:5
3: <simple_logger::SimpleLogger as log::Log>::log
4: log::__private_api_log
5: noaa_apt::gui::gui::create_window
6: ::connect_startup::startup_trampoline
7: _g_closure_invoke
8: _signal_emit_unlocked_R
9: _g_signal_emit_valist
10: _g_signal_emit
11: _g_application_register
12: _g_application_real_local_command_line
13: _g_application_run
14: ::run
15: noaa_apt::gui::gui::main
16: noaa_apt::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.
Workaround
Adding .with_utc_timestamps() to the SimpleLogger initialization in line 46 of src/main.rs worked around this problem.
The text was updated successfully, but these errors were encountered:
I put a reminder in my phone to look and understand this in 2 weeks. I think it is slightly better to use local time instead of UTC. Apparently it is something new since the things I found when googling are recent, and I'm afraid that the libraries will change very soon:
Now I updated the dependency simple_logger to 2.0.0, this makes the program use .with_utc_timestamps() by default (borntyping/rust-simple_logger#43). I would like to show logs in local time as previously but apparently there is not a simple way to do it in rust safely for all timezones.
Base system
Built on macOS Monterey 12.2 Beta (21D5025f) from master following instructions https://noaa-apt.mbernardi.com.ar/development.html#mac--osx
My system timezone is
IST
(UTC+0530
)Problem
Launching
./target/release/noaa-apt
shows this error:❯ ./target/release/noaa-apt
thread 'main' panicked at 'Could not determine the UTC offset on this system. Possible causes are that the time crate does not implement "local_offset_at" on your system, or that you are running in a multi-threaded environment and the time crate is returning "None" from "local_offset_at" to avoid unsafe behaviour. See the time crate's documentation for more information. (https://time-rs.github.io/internal-api/time/index.html#feature-flags): IndeterminateOffset', /Users/arun/.cargo/registry/src/github.com-1ecc6299db9ec823/simple_logger-1.16.0/src/lib.rs:409:85
stack backtrace:
0: rust_begin_unwind
at /rustc/404c8471aba60c2d837fa728e7c729a0f52d5830/library/std/src/panicking.rs:498:5
1: core::panicking::panic_fmt
at /rustc/404c8471aba60c2d837fa728e7c729a0f52d5830/library/core/src/panicking.rs:107:14
2: core::result::unwrap_failed
at /rustc/404c8471aba60c2d837fa728e7c729a0f52d5830/library/core/src/result.rs:1661:5
3: <simple_logger::SimpleLogger as log::Log>::log
4: log::__private_api_log
5: noaa_apt::gui::gui::create_window
6: ::connect_startup::startup_trampoline
7: _g_closure_invoke
8: _signal_emit_unlocked_R
9: _g_signal_emit_valist
10: _g_signal_emit
11: _g_application_register
12: _g_application_real_local_command_line
13: _g_application_run
14: ::run
15: noaa_apt::gui::gui::main
16: noaa_apt::main
note: Some details are omitted, run with
RUST_BACKTRACE=full
for a verbose backtrace.Workaround
Adding
.with_utc_timestamps()
to theSimpleLogger
initialization in line 46 ofsrc/main.rs
worked around this problem.The text was updated successfully, but these errors were encountered: