News for hackers. Stuff that matters.
Re:Formatting code should be unnecessary by saagarjha on Monday September 08, 2025 @06:56AM (#45166796)
This makes it really annoying to grep for log messages. I can't control what you do in your codebase but I will always argue against this the ones I work on.
Re:Formatting code should be unnecessary by layer8 on Monday September 08, 2025 @07:06AM (#45166860)
I haven’t found this to be a problem in practice. You generally can’t grep for the complete message anyway due to inserted arguments. Picking a distinctive formulation from the log message virtually always does the trick. I do take care to not place line breaks in the middle of a semantic unit if possible.
Re:Formatting code should be unnecessary by saagarjha on Monday September 08, 2025 @07:09AM (#45166880)
Yes, I find the part of the message that doesn't have interpolated arguments in it. The problem is that the literal part of the string might be broken up across lines.
Re:Formatting code should be unnecessary by bogomog on Monday September 08, 2025 @06:12PM (#45174720)
And to add to this, you rarely need to read a log message when just visually scanning code, its fine going off the screen.