1 best, ideally, through a configuration file or command line argument (--quiet)
2 just clutter up your code
If you want to avoid the expensive string construction (this probably costs about 0.001% of the time in my experience), use:
if logger.isEnabledFor(logging.DEBUG):
logger.debug("Message with %s, %s", expensive_func1(),
expensive_func2())
http://docs.python.org/library/logging.html#optimization
source
share