Skip to content

Commit

Permalink
fix(chain-ops): Format log filenames in a number-sortable way
Browse files Browse the repository at this point in the history
  • Loading branch information
KirilMihaylov committed Aug 6, 2024
1 parent ce95a08 commit 46bf7ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ impl<'r> DateTimeSegmentedWriter<'r> {
let mut file_path = self.directory_path.to_owned();

[
format!("year-{}", date_and_hour.year),
format!("month-{}", date_and_hour.month),
format!("day-{}", date_and_hour.day),
format!("year-{:0>2}", date_and_hour.year),
format!("month-{:0>2}", date_and_hour.month),
format!("day-{:0>2}", date_and_hour.day),
]
.into_iter()
.try_for_each(|segment| {
Expand All @@ -98,7 +98,7 @@ impl<'r> DateTimeSegmentedWriter<'r> {
})?;

let file_path = {
file_path.push(format!("hour-{}.log", date_and_hour.hour));
file_path.push(format!("hour-{:0>2}.log", date_and_hour.hour));

file_path
};
Expand Down

0 comments on commit 46bf7ff

Please sign in to comment.