Skip to content

Conversation

fpawel
Copy link

@fpawel fpawel commented Jul 15, 2023

image
Golals:

  • correct processing of structural logging groups
  • correct implementation of the interface interface { WithGroup(name string) slog.Handler } in accordance with slog contract
  • additional logger options useful for local debugging

for example the following statement

log.WithGroup("group1").WithGroup("group2").Info("msg", slog.Group("group3", slog.Group("group4", "k1", "v1", "k2", "v2")))

produces something like the following output with the original version of the logger from the current main branch

[20:16:16.624] INFO: msg {
  "group3": [
    {
      "Key": "group4",
      "Value": {}
    }
  ]
}

and more meaningful output with corrected logger

INFO msg {"group1":{"group2":{"group3":{"group4":{"k1":"v1","k2":"v2"}}}}} main.go:31.main

Pease don't forget to squash before merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant