Re:Logging as a code smell
by zaptheimpaler on Tuesday January 11, 2022 @01:05AM
(#29888144)
It's a good point but I think the author sort of drove past the key insight. This is called structured logging. Having some kind of consistent schema of log messages is much better than plain strings for analysis later. It's just building a loose schema of events/log types, and picking a serialization format for said schema. JSON is popular because it remains human readable as well. I agree though, it really is very useful, not much harder than logging strings, and it's easy to evolve an existing system to gradually add structure to logs.
[ Parent
| on HN ]