Fix up arguments to logging methods.

Review Request #12704 — Created Oct. 28, 2022 and submitted — Latest diff uploaded

Information

Djblets
release-4.x

Reviewers

We have a special logging formatter that is used to show info when a
django HttpRequest is part of the log record. Once upon a time, the way
of getting extra information into a log record was just to pass it as
additional kwargs to the logging methods, but the modern, documented
way of doing it is to pass a single extra dict. Some of our code uses
extra, but most of it is just passing in request= as a kwarg. I've
fixed this up, plus added the request in logging methods where we had it
available but weren't plumbing it.

In addition, there were a couple instances where we were passing
exc_info=1 instead of exc_info=True. I've fixed these up to make
type checkers happier.

Ran unit tests.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Fix up arguments to logging methods.
We have a special logging formatter that is used to show info when a django HttpRequest is part of the log record. Once upon a time, the way of getting extra information into a log record was just to pass it as additional `kwargs` to the logging methods, but the modern, documented way of doing it is to pass a single `extra` dict. Some of our code uses `extra`, but most of it is just passing in `request=` as a kwarg. I've fixed this up, plus added the request in logging methods where we had it available but weren't plumbing it. In addition, there were a couple instances where we were passing `exc_info=1` instead of `exc_info=True`. I've fixed these up to make type checkers happier. Testing Done: Ran unit tests.
afed7adb54a4fc231365c72880c7a0a3b8db783b David Trowbridge
djblets/auth/ratelimit.py
djblets/configforms/views.py
djblets/datagrid/grids.py
djblets/extensions/templatetags/djblets_extensions.py
djblets/extensions/tests/test_extension_manager.py
djblets/log/__init__.py
djblets/log/middleware.py
djblets/siteconfig/context_processors.py
djblets/util/contextmanagers.py
djblets/webapi/decorators.py
djblets/webapi/resources/base.py
Loading...