Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I set a breakpoint somewhere and it ended up being a location that was useful, that's usually a good place for a log statement.

As for your point about logging being a fail condition, I was working on a distributed system where I had no control over which instance my code was running on. I would attach a debugger and make the same request a dozen times before the instance I had attached the debugger to processed the request. This wasn't a system I could setup a local instance of. I also couldn't reduce the instances to a single one because there were other devs, testers, data engineers working on it and the system did raster processing that regulary took 1-5 minutes. I resorted to log debugging.



Yes logging is good in many cases. It means you can observe the whole execution of your program by simply reading the whole log. Whereas when you debug you can only debug a selected set of branches. I do both.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: