Skip to content

Commit

Permalink
Structured logging in Go, closes #28
Browse files Browse the repository at this point in the history
  • Loading branch information
rednafi committed Aug 13, 2023
1 parent 7146288 commit c352f15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/go/structured_logging_with_slog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ cases.

## Kickoff

Here's how you'd add levels to your log message:
Here's how you'd add levels to your log messages:

```go
package main
Expand Down Expand Up @@ -301,6 +301,7 @@ It prints:

```txt
2023/08/11 01:56:44 INFO an info message sticky_key=sticky_value
2023/08/11 01:56:44 ERROR an error message sticky_key=sticky_value
```

The `Logger.With()` method accepts key-value pairs of attributes. This saves you from
Expand Down

0 comments on commit c352f15

Please sign in to comment.