For a new application, I want to set up logging. The app is going to contain several modules, that will require the same kind of configuration. So I create a module my_company/logging.py
:
import logging # the standard Python logging
def configure():
logging.getLogger('module1').setLevel(logging.INFO)
logging.getLogger('module2').setLevel(logging.WARNING)
mypy
does not really like this:
my_company/logging.py:6: error: Module has no attribute "getLogger"
Found 1 error in 1 file (checked 3 source files)
How can I make mypy see that it should use the logging
module python distribution, not from the my_company
folder?