News for hackers. Stuff that matters.
Re:My Logging Best Practices (2020) by Jowsey on Tuesday October 05, 2021 @12:45PM (#28761926)
Why not have the program write logs to a temp file somewhere at trace/debug level, and only output the standard level to the console?
Re:My Logging Best Practices (2020) by Cicero22 on Tuesday October 05, 2021 @12:48PM (#28761975)
Wouldn't that end up slowing down the whole system from writing to a file though?
Re:My Logging Best Practices (2020) by Jowsey on Tuesday October 05, 2021 @12:54PM (#28762063)
Ah, suppose it depends on how much you're doing and/or how verbose your logs are. If you've got lines speeding past then yeah I maybe wouldn't write them all.
Re:My Logging Best Practices (2020) by grey-area on Tuesday October 05, 2021 @01:38PM (#28762759)
Writing verbose logs is very expensive.
Re:My Logging Best Practices (2020) by worik on Tuesday October 05, 2021 @02:51PM (#28763868)
It depends which costs what.

In a case where there are plenty of resources and the thing you are logging is very heavy then even verbose logging is trivial.

If you are beset by failures it is much cheaper than making your developers guess.