mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-07-24 08:52:35 +00:00
16 lines
455 B
MoonBit
16 lines
455 B
MoonBit
fn main {
|
|
let logger = @lib.build_logger(
|
|
@lib.text_console(
|
|
min_level=@lib.Level::Info,
|
|
target="demo.formatter",
|
|
text_formatter=@lib.TextFormatterConfig::new(
|
|
show_timestamp=false,
|
|
separator=" | ",
|
|
field_separator=",",
|
|
template="[{level}] {target} {message} :: {fields}",
|
|
),
|
|
),
|
|
)
|
|
logger.info("formatted output", fields=[@lib.field("user", "alice"), @lib.field("request_id", "42")])
|
|
}
|