Fix up arguments to logging methods.
Review Request #12704 — Created Oct. 28, 2022 and submitted
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
additionalkwargs
to the logging methods, but the modern, documented
way of doing it is to pass a singleextra
dict. Some of our code uses
extra
, but most of it is just passing inrequest=
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 ofexc_info=True
. I've fixed these up to make
type checkers happier.
Ran unit tests.
Summary | ID |
---|---|
afed7adb54a4fc231365c72880c7a0a3b8db783b |
-
-
The
request=
is actually a custom feature of our logging add-ons.extra=
was historically the way custom data went in, and is whatrequest=
ultimately does. Sorequest=
is actually API provided bydjblets.log
.I still prefer
request=
just for the convenience of it, to be honest.If we're for sure going to get rid of it, we should formally deprecate it.
- Change Summary:
-
Add a deprecation warning
- Commits:
-
Summary ID 1c063cce8c0b820b1509e927d72b473d5894e990 afed7adb54a4fc231365c72880c7a0a3b8db783b - Diff:
-
Revision 2 (+86 -58)