Skip to content

Commit

Permalink
fixup! Add example test for log/slog.
Browse files Browse the repository at this point in the history
  • Loading branch information
koenbollen committed Aug 11, 2023
1 parent 366ec28 commit e4829a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/slog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Go's log/slog json handler

$ go run examples/mocks/slog.go
$ pwd
asd

$ go run ./mocks/slog.go
{"time":"2023-08-11T16:35:31.162712808+02:00","level":"INFO","msg":"hello","count":3}
{"time":"2023-08-11T16:35:31.162796194+02:00","level":"WARN","msg":"failed","err":"EOF"}

$ go run examples/mocks/slog.go | jl
$ go run ./mocks/slog.go | jl
[2023-08-11 16:34:29] INFO: hello [count=3]
[2023-08-11 16:34:29] WARNING: failed [err=EOF]

0 comments on commit e4829a6

Please sign in to comment.