Hacker News new | ask | show | jobs
by ilyt 1101 days ago
> As a non-developer who has only gone as far as "hello world" in Go, I'm baffled by the idea that the log/slog thing is new - that seems like an absolutely basic language feature.

Then you'd be even more surprised when you learn that the vast majority of languages do not have standard logging library in core.

Most have one or few common libraries that community developed instead, but they are not in stdlib, and if stdlib has one it's usually very simple one (Go had standard logger interface that was too simple for example)

1 comments

I have evidently been spoiled by Python and it's abundance of batteries.
Python does not include a structure d logging package as part of the stdlib as far as I know. What package are you thinking does what slog does?
Just the standard "logging" - might not meet the definition of "structured logging", but at a glance it seems about as featureful as what is being added to Go right now.
Python has no equivalent of logger.With or other k/v pairs, which is what makes it structured logging and why it's interesting at all. Go has had unstructured logging since its early days.
I don't really follow what the benefit of the k/v thing is relative to just passing in a suitable string. I'd just assumed that the automation of "debug", "info" etc was what made it structured.