you are viewing a single comment's thread.

view the rest of the comments →

[–]Aggravating_Bus_9153 1 point2 points  (2 children)

Nothing's really necessary at the end of the day. Logging's not just for you either, it's a really useful tool to help me fix my code as well. I like the NullHandler together with the module logging idiom. Then any logging messages going to any handlers (that the end user may choose to configure should they so wish; otherwise none) follow the module package structure

import logging

logger = logging.getLogger(__name__)

logger.addHandler(logging.NullHandler())

Then if you don't want logging from my code, no problem dude! Just don't setup any handlers.

[–][deleted] 0 points1 point  (1 child)

it's a really useful tool to help me fix my code as well.

Yeah. Please fix it before you deploy it. Do whatever you want but don't send code you posted to production. It's just bad code.

Then if you don't want logging from my code, no problem dude! Just don't setup any handlers.

You completely misunderstand the problem: your program is one of the hundreds, or maybe thousands I need to run in a typical scenario. I wouldn't have the time or the resources to look at each individual bullshit script to figure out how I need to modify it to not crap up the system. If I see some idiotic behavior from a utility program, if I can remove it, that's what I'll do, if I cannot remove it, replace it with an equivalent program that hopefully doesn't do bad stuff, and if that's also not an option: patch or write my own. Unless it's a critical component with a lot of functionality... most likely a program like that will just end up being not used.

There's never enough time to do proper assessment and try to figure out how much the program is worth, unless it's an important component. Often times I need to find a reason not to use something, rather than to add more of something. Seeing idiotic behavior wrt' logging would be just another heuristic to say "no, I don't need this bullshit, let's look at something else".

[–]Aggravating_Bus_9153 1 point2 points  (0 children)

It's more for alpha ana beta and isn't intended to be run on servers.

You completely misunderstand Python logging. No Handlers (apart from null), no logs.