Add file sink rotation and retention

This commit is contained in:
Nanaloveyuki
2026-05-09 21:24:02 +08:00
parent 18479a8b6f
commit fa2a165942
11 changed files with 299 additions and 16 deletions
+4 -1
View File
@@ -49,7 +49,10 @@ fn main {
if @lib.native_files_supported() {
let file_logger = @lib.Logger::new(
@lib.file_sink("bitlogger-example.log"),
@lib.file_sink(
"bitlogger-example.log",
rotation=Some(@lib.file_rotation(128, max_backups=2)),
),
min_level=@lib.Level::Info,
target="file",
)