Use named modules for integration modules logger.

Review Request #11812 — Created Sept. 17, 2021 and submitted — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

When using a logger, one of the challenges that you can run into is
determining where a logger is being called. This uncertainty can be
removed by providing the logger with a name. While you could choose
to name loggers yourselfdepending on the usecase, the recommended
convention is to use Python's __name__ variable to easily identify
where the logger is acting. One instance within the codebase that
used an unnamed logger was within reviewboard/reviewboard/integrations/.

models.py is the only file (excluding tests) within /integrations/ that
uses a logger, so it has been renamed with
__name__ to reviewboard.integrations.models.

This update did require a change to test_configs within integrations as well
to ensure it knew which logger to listen to.

- Ran all of the python unit tests once the changes were added

Diff Revision 3 (Latest)

orig
1
2
3

Commits

First Last Summary ID Author
Use named modules for integration modules logger.
When using a logger, one of the challenges that you can run into is determining where a logger is being called. This uncertainty can be removed by providing the logger with a name. While you could choose to name loggers yourself depending on the usecase, the recommended convention is to use Python's `__name__` variable to easily identify where the logger is acting. One instance within the codebase that used an unnamed logger was within `/reviewboard/reviewboard/integrations/`. models.py is the only file (excluding tests) within `/integrations/` that uses a logger, so it has been renamed with `__name__` to `reviewboard.integrations.models`. This update did require a change to `test_configs` within integrations as well to ensure it knew which logger to listen to. Testing Done: - Ran all of the python unit tests once the changes were added
7ee09538467192de2355dca8f7af3795263a3860 Jordan
reviewboard/integrations/models.py
reviewboard/integrations/tests/test_configs.py
Loading...