]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Fix up Python logging metadata
authorMarkus Gerstel <markus.gerstel@diamond.ac.uk>
Wed, 26 Jan 2022 09:56:40 +0000 (04:56 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 27 Jan 2022 20:54:57 +0000 (15:54 -0500)
commitf24a34140f6007cada900a8ae5ed03fe40ce2631
tree3e9aa699b05e8bcb875580a50728ce162dd71bcf
parent46321a844f4143eed2dc03eaefc53d51b5484bc6
Fix up Python logging metadata

Adjusted the logging for key SQLAlchemy components including
:class:`_engine.Engine`, :class:`_engine.Connection` to establish an
appropriate stack level parameter, so that the Python logging tokens
``funcName`` and ``lineno`` when used in custom logging formatters will
report the correct information, which can be useful when filtering log
output; supported on Python 3.8 and above. Pull request courtesy Markus
Gerstel.

Fixes: #7612
Closes: #7615
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7615
Pull-request-sha: cf9567beb06680df320cb12dde1f15baa68e1eb5

Change-Id: Iff23c92ef3453ac93cbd0d190e7efbf8ea4457a2
doc/build/changelog/unreleased_14/7612.rst [new file with mode: 0644]
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/log.py
test/engine/test_logging.py