2 ms·
Yes, otherwise you can get messages from noisy libraries bubbling up to the user that may not be relevant in the app context. If the logging is just going to a
by mixmastamyk 11y ago
Yes, otherwise you can get messages from noisy libraries bubbling up to the user that may not be relevant in the app context. If the logging is just going to a file to look at later it matters less, still sometimes it is nice to shut them up.
- m_mueller 11y agoGood points. I'll probably switch to the modular way in the next project.
- pyre 11y agoExamples of libraries that can be noisy: * Flask-CORS: When I first started using this it's default logging level was really noisy. * factory (aka Factory Boy): You can turn in DEBUG level to get a deluge of information about what is happening with your test data. * SQLAlchemy: The 'echo' option to create_engine isn't the only way that you can control logging. E.g.: import logging logging.basicConfig() logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO) Using logging_tree will give you a good idea of the loggers that have been initialized on the libraries that you're using.