this post was submitted on 13 Jul 2026
2 points (100.0% liked)

Lobste.rs

390 readers
36 users here now

RSS Feed of lobste.rs

Source of the RSS Bot

founded 2 years ago
MODERATORS
 

My assumption was always: Applications log (and err), libraries err. Today, I was shocked to learn that various ecosystems love logging things in libraries (such that silencing those logs is even an important task). My view of logs has been around wide discrete events OR (for small scale personal things) writing errs in a file. I was particularly surprised to learn this was an important consideration of making Go's slog, since you can easily propagate and enrich errors... Why not just err (and handle them by e.g. adding to the log context then retrying)? Or pass extra details in the return package? What workflows etc. make this desirable? All I've been able to think of is the ability to change the log level and silence random extra information.

you are viewing a single comment's thread
view the rest of the comments
[–] jbrains@sh.itjust.works 1 points 6 days ago

Libraries raise errors. Applications choose how to handle them. 🤷