Four ways to extend the go 1.21 slog Logger
In my previous blog post on the Anchorage Digital blog, I wrote about logging features I’d love to see built around the new slog package coming in Go 1.21. I heard from several people that they want to learn more about how exactly to do this. To answer these questions, I built out 6 examples of how to extend slog, showing 4 different strategies. I used some of the use-cases from the last blog post. The example code and detailed explanations can be found here. Feel free to copy-paste and modify any of these examples. ...