mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 23:52:27 +00:00
📝 Polish onboarding and add feature examples
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
fn main {
|
||||
let config = @lib.parse_logger_config_text(
|
||||
"{\"min_level\":\"debug\",\"target\":\"demo.config\",\"sink\":{\"kind\":\"text_console\",\"text_formatter\":{\"show_timestamp\":false,\"separator\":\" | \",\"template\":\"[{level}] {target} {message}\"}},\"queue\":{\"max_pending\":2,\"overflow\":\"DropOldest\"}}",
|
||||
) catch {
|
||||
err => {
|
||||
ignore(err)
|
||||
println("invalid config")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
let logger = @lib.build_logger(config)
|
||||
logger.info("queued one")
|
||||
logger.info("queued two")
|
||||
logger.info("queued three")
|
||||
ignore(logger.flush())
|
||||
}
|
||||
Reference in New Issue
Block a user