This commit is contained in:
ge
2026-01-03 16:38:28 +03:00
commit 1fa21a9c74
12 changed files with 623 additions and 0 deletions

16
examples/logging_levels.v Normal file
View File

@@ -0,0 +1,16 @@
import structlog
fn main() {
// Initialize logger with non-default logging level.
log := structlog.new(level: .trace) // try to change logging level
defer {
log.close()
}
log.trace().message('hello trace').send()
log.debug().message('hello debug').send()
log.info().message('hello info').send()
log.warn().message('hello warn').send()
log.error().message('hello error').send()
log.fatal().message('hello fatal').send() // on fatal program exits immediately with exit code 1
}