this post was submitted on 03 Sep 2024
851 points (99.4% liked)

Programmer Humor

32361 readers
873 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 55 points 2 months ago (3 children)

This is where printf debugging really shines, ironically.

[โ€“] [email protected] 5 points 1 month ago* (last edited 1 month ago)

Honestly, this is why I tell developers that work with/for me to build in logging, day one. Not only will you always have clarity in every environment, but you won't run into cases where adding logging later makes races/deadlocks "go away mysteriously." A lot of the time, attaching a debugger to stuff in production isn't going to fly, so "printf debugging" like this is truly your best bet.

To do this right, look into logging modules/libraries that support filtering, lazy evaluation, contexts, and JSON output for perfect SEIM compatibility (enterprise stuff like Splunk or ELK).

load more comments (2 replies)