Skip to content

Commit

Permalink
fix #25
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Sep 20, 2023
1 parent 069fb6c commit b017490
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions example/src/split_log_date.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use fast_log::config::Config;
use fast_log::consts::LogSize;
use fast_log::error::LogError;
use fast_log::plugin::file_split::{Packer, KeepType};
use fast_log::plugin::file_name::FileName;
use fast_log::plugin::file_split::{KeepType, Packer};
use std::fs::{File, OpenOptions};
use std::io::{Read, Write};
use std::path::Path;
Expand All @@ -18,13 +19,7 @@ impl DateLogPacker {
first_file_path: &str,
date: fastdate::DateTime,
) -> String {
let path = Path::new(first_file_path);
let file_name = path
.file_name()
.unwrap_or_default()
.to_str()
.unwrap_or_default()
.to_string();
let file_name = first_file_path.extract_file_name();
let mut new_log_name = date.to_string().replace(" ", "T").replace(":", "-");
new_log_name.push_str(".");
new_log_name.push_str(self.pack_name());
Expand Down

0 comments on commit b017490

Please sign in to comment.