Skip to content

Commit

Permalink
Fix format and typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lioriz committed Sep 21, 2024
1 parent 6db9177 commit ac9b5dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions spdlog/examples/02_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ fn configure_rotating_period_file_logger() -> Result<(), Box<dyn std::error::Err
let file_sink = Arc::new(
RotatingFileSink::builder()
.base_path(path)
.rotation_policy(RotationPolicy::Period { duration: (chrono::Duration::hours(1) +
chrono::Duration::minutes(2) +
chrono::Duration::seconds(3)).to_std().unwrap() })
.rotation_policy(RotationPolicy::Period {
duration: (chrono::Duration::hours(1)
+ chrono::Duration::minutes(2)
+ chrono::Duration::seconds(3))
.to_std()
.unwrap(),
})
.build()?,
);
let new_logger = Arc::new(Logger::builder().sink(file_sink).build()?);
Expand Down
1 change: 0 additions & 1 deletion spdlog/src/sink/rotating_file_sink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ fn days(days: u64) -> Duration {
chrono::Duration::days(days as i64).to_std().expect(format!("Failed to create Duration::days({}", days).as_str())
}

git
fn weeks(weeks: u64) -> Duration {
chrono::Duration::weeks(weeks as i64).to_std().expect(format!("Failed to create Duration::weeks({}", weeks).as_str())
}
Expand Down

0 comments on commit ac9b5dc

Please sign in to comment.