Skip to content

Commit a21d9c5

Browse files
committed
Renamed LoggedQuery attrs
1 parent 67dbc42 commit a21d9c5

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

asyncpg/connection.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ def add_query_logger(self, callback):
229229
:param callable callback:
230230
A callable or a coroutine function receiving one argument:
231231
**record**: a LoggedQuery containing `query`, `args`, `timeout`,
232-
`elapsed`, `addr`, `params`, and `exception`.
232+
`elapsed`, `exception`, `conn_addr`, and
233+
`conn_params`.
233234
234235
.. versionadded:: 0.29.0
235236
"""
@@ -1703,7 +1704,8 @@ def logger(self, callback):
17031704
:param callable callback:
17041705
A callable or a coroutine function receiving one argument:
17051706
**record**: a LoggedQuery containing `query`, `args`, `timeout`,
1706-
`elapsed`, `addr`, `params`, and `exception`.
1707+
`elapsed`, `exception`, `conn_addr`, and
1708+
`conn_params`.
17071709
17081710
Example:
17091711
@@ -1741,9 +1743,9 @@ def _time_and_log(self, query, args, timeout):
17411743
args=args,
17421744
timeout=timeout,
17431745
elapsed=elapsed,
1744-
addr=self._addr,
1745-
params=self._params,
17461746
exception=exception,
1747+
conn_addr=self._addr,
1748+
conn_params=self._params,
17471749
)
17481750
for cb in self._query_loggers:
17491751
if cb.is_async:
@@ -2416,7 +2418,8 @@ class _ConnectionProxy:
24162418

24172419
LoggedQuery = collections.namedtuple(
24182420
'LoggedQuery',
2419-
['query', 'args', 'timeout', 'elapsed', 'exception', 'addr', 'params'])
2421+
['query', 'args', 'timeout', 'elapsed', 'exception', 'conn_addr',
2422+
'conn_params'])
24202423
LoggedQuery.__doc__ = 'Log record of an executed query.'
24212424

24222425

0 commit comments

Comments
 (0)