📝 Polish onboarding and add feature examples

This commit is contained in:
Nanaloveyuki
2026-05-20 11:40:23 +08:00
parent 5f12991592
commit e019db11d6
16 changed files with 244 additions and 22 deletions
+19
View File
@@ -0,0 +1,19 @@
fn main {
if !@lib.native_files_supported() {
println("native file sink is not available on this backend")
return
}
let logger = @lib.Logger::new(
@lib.file_sink(
"bitlogger-example.log",
auto_flush=true,
rotation=Some(@lib.file_rotation(128, max_backups=2)),
),
min_level=@lib.Level::Info,
target="demo.file",
)
logger.info("file rotation ready", fields=[@lib.field("kind", "file")])
ignore(logger.sink.flush())
ignore(logger.sink.close())
}
+7
View File
@@ -0,0 +1,7 @@
import {
"Nanaloveyuki/BitLogger/src" @lib,
}
options(
"is-main": true,
)