mirror of
https://github.com/gechandesu/structlog.git
synced 2026-01-23 16:04:14 +03:00
init
This commit is contained in:
17
examples/unix_timestamp.v
Normal file
17
examples/unix_timestamp.v
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import structlog
|
||||
|
||||
fn main() {
|
||||
// Initialize logger with edited timestamp.
|
||||
log := structlog.new(
|
||||
timestamp_format: .unix
|
||||
handler: structlog.JSONHandler{
|
||||
writer: os.stdout()
|
||||
}
|
||||
)
|
||||
defer {
|
||||
log.close()
|
||||
}
|
||||
|
||||
log.info().message('Hello, World!').send()
|
||||
}
|
||||
Reference in New Issue
Block a user