5 ms·
> Throwing away log levels is literally throwing away more signal, which is going to make life harder, not easier. Signal that can't be used is just noise, and
by shadowgovt 3y ago
> Throwing away log levels is literally throwing away more signal, which is going to make life harder, not easier.
Signal that can't be used is just noise, and noise complicates solving a problem by interfering with the signal.
In projects I work on, I generally only use two logging levels: info and error. Error indicates unrecoverable conditions that mean an execution context is terminating. Info is everything else. "Warn" is useless because something is only a warning in a particular context and I don't have that context when I'm building the logs. "Debug" is a lie; logging isn't debugging, and if I need to debug I need to slap an actual debugger on the binary with source code available.
I couple that with the ability to turn on and off logging at a fine-grained module level and (if I'm living my best life) being able to instrument the production code for breakpointing and logging on the fly (via systems such as Google Cloud Debugger).