Skip to content

Commit

Permalink
修复Linux日志unknown time (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
hguandl committed Jul 28, 2023
1 parent 1f9e5c4 commit 1e08a5f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ async fn main() -> Result<()> {
// tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
let cli = Cli::parse();

unsafe {
time::util::local_offset::set_soundness(time::util::local_offset::Soundness::Unsound);
}

let timer = tracing_subscriber::fmt::time::LocalTime::new(format_description!(
"[year]-[month]-[day] [hour]:[minute]:[second]"
));
Expand Down
6 changes: 6 additions & 0 deletions crates/stream-gears/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ fn download(
py.allow_threads(|| {
let map = construct_headers(header_map);
// 输出到控制台中
unsafe {
time::util::local_offset::set_soundness(time::util::local_offset::Soundness::Unsound);
}
let local_time = tracing_subscriber::fmt::time::LocalTime::new(format_description!(
"[year]-[month]-[day] [hour]:[minute]:[second]"
));
Expand Down Expand Up @@ -181,6 +184,9 @@ fn upload(
.enable_all()
.build()?;
// 输出到控制台中
unsafe {
time::util::local_offset::set_soundness(time::util::local_offset::Soundness::Unsound);
}
let local_time = tracing_subscriber::fmt::time::LocalTime::new(format_description!(
"[year]-[month]-[day] [hour]:[minute]:[second]"
));
Expand Down

0 comments on commit 1e08a5f

Please sign in to comment.