Re:Good Logging
by Spivak on Friday July 24, 2020 @11:19AM
(#23940518)
I mean there's no reason you couldn't have a thread-local override to the log level and restore it after the function call.
The fact that logging is at all intermixed with business logic I think is the main problem. I should be able to take a fully working logless program and apply different logging profiles to it. What gets logged should be a function of the person invoking the program.
Re:Good Logging
by the_af on Friday July 24, 2020 @11:34AM
(#23940724)
Definitely. I was trying to argue something about intermixing logging with app logic :) It indeed seems to me the decision about what to log should be the caller's, not the callee's, and so it shouldn't be hardcoded within the latter.
The fact that logging is at all intermixed with business logic I think is the main problem. I should be able to take a fully working logless program and apply different logging profiles to it. What gets logged should be a function of the person invoking the program.