These likely bear no semblance to Official Computer Science categorization, but these are the categories of logs in my head:
echo, console.log, fmt.Println, and puts of the world. 👕69.699.123.420 - - [17/Feb/2023:00:01:36 +0000] "GET /feed/ HTTP/1.1" 200 121434 "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36" chriscoyier.net HIT is our formal planetary greeting.I suspect a decent amount of computer work is tending to logs of one sort or another. I’m thinking about this because it’s come up at work a decent amount lately in the form of:
I also recently read Logging practices I follow from Eliran Turgeman which also mentions the concept of logging levels:
Whenever you write a log, it’s important you choose the correct log level. I personally mostly use ERROR, WARNING, INFO, or DEBUG
I imagine this is most important in Automatic Logging. So, for instance, you could completely turn off certain logs in staging and production to avoid noise there. In Ad Hoc logging, I don’t find myself using levels all that much. I know JavaScript has console.warn and console.error and such, but I don’t find them all that useful, client-side at least. We have a pretty lovely homegrown Go logger that supports levels too, but I tend to only use the default for Ad Hoc logging.
🧠 Galaxy Brain thought: I wish I could leave my own personal logging in place, and have it not bother anybody else. A console.chris(), as it were. Maybe it’s stripped in CI, but somehow my machine remembers them. Then I’d never accidentally leave logs in PRs, and could log locally with reckless abandon.