__init__.py 949 B

12345678910111213141516171819202122232425262728
  1. # -*- coding: utf-8 -*-
  2. """
  3. (c) 2020 - Copyright ...
  4. Authors:
  5. zPlus <zplus@peers.community>
  6. Notes
  7. This module is kept empty because when the module forgefed.tasks is
  8. imported by celery (when the queue worker is started), __init__.py is
  9. also executed and we don't want to start a new Flask instance.
  10. The entry point of the application is app.py.
  11. We only set the logging options here because the "logging" module works
  12. hierarchically. When we create a new log object using
  13. logging.getLogger(__name__) the logger object is called
  14. "forgefed.modulename" and will inherit its settings from the root
  15. logger. So we set them here instead of in every single module.
  16. https://docs.python.org/3/library/logging.html#logger-objects
  17. """
  18. import logging
  19. from . import settings
  20. log = logging.getLogger(__name__)
  21. log.setLevel(settings.LOG_LEVEL)