Skip to content

Commit

Permalink
add impl CanPack
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Jul 28, 2024
1 parent 1df2cd2 commit 30859e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion example/src/split_log.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use std::thread::sleep;
use fast_log::config::Config;
use fast_log::consts::LogSize;
use fast_log::plugin::file_split::{PackType, KeepType};
Expand Down
4 changes: 2 additions & 2 deletions src/plugin/file_split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ impl CanPack for PackType {
if dt.day() > date_time.day() {
let last_time = date_time.clone();
*date_time = dt;
Some(temp_name.to_string() + &last_time.format("YYYY-MM-DDThh-mm-ss.000000.log"))
Some(temp_name.replace(".log",&last_time.format("YYYY-MM-DDThh-mm-ss.000000.log")))
} else {
None
}
}
PackType::BySize(limit) => {
if temp_size >= limit.get_len() {
Some(temp_name.to_string() + &DateTime::now().format("YYYY-MM-DDThh-mm-ss.000000.log"))
Some(temp_name.replace(".log",&DateTime::now().format("YYYY-MM-DDThh-mm-ss.000000.log")))
} else {
None
}
Expand Down

0 comments on commit 30859e5

Please sign in to comment.