Added logger global variable to have named logging in files in reviewboard.attachments

Review Request #11394 — Created Jan. 22, 2021 and discarded — Latest diff uploaded

Information

Review Board
release-4.0.x

Reviewers

Previously logging in reviewboard/reviewboard/attachments was
un-named logging. This means it's hard to determine where the
error came from in the logs.

To fix this a global logger variable was defined in each file
that adds the location of the file to the error message.

Added unit test for unregister_mimetype_handler that passes it an
unregistered handler. This should cause an error to be logged. The
unit test listens to whether or not the logger ran.

Ran ./tests/runtests.py reviewboard.attachments and passed all 32 tests.

Diff Revision 1

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

orig
1
2
3
4

Commits

First Last Summary ID Author
added logger global variable to have named logging in files in reviewboard/re...
af955d6577f0c7a5c14f95c82ad42a3a0810ab58 Ryan Kang
added test that unregister handler logs when handler is unregistered
aa0b092d17a7b02fcc31d5df99c84226da95bdda Ryan Kang
reviewboard/attachments/mimetypes.py
reviewboard/attachments/models.py
reviewboard/attachments/tests.py
Loading...