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 1

This is not the most recent revision of the diff. The latest diff is revision 3. See what's changed.

orig
1
2
3

Commits

First Last Summary ID Author
Use named modules for integration modules logger.
An easyfix bug (ticket #4906) suggested that a logger can be more useful if it is named using the built in __name__variable. models.py is the only file (excluding tests) that uses the logger, so now the logger within that part of the code will be called "reviewboard.integrations.models". This change was tested by running all of the python unit tests. This change did require an alteration to the unit test to ensure that it knew which logger to be watching for changes on. Testing Done: - Ran all of the python unit tests once the changes were added
ee45a589b67befdeca3deb7b6c5896fef182c1fb Jordan
reviewboard/integrations/models.py
reviewboard/integrations/tests/test_configs.py
Loading...