我想记录psycopg2正在进行的查询,但psycopg2文档并未真正指定应如何使用LoggingConnection.
import logging
from psycopg2.extras import LoggingConnection
db_settings = {
"user": "abcd",
"password": "efgh",
"host": "postgres.db",
"database": "dev",
}
conn = LoggingConnection(**db_settings)
Run Code Online (Sandbox Code Playgroud)
给出错误
LoggingConnection(**db_settings)TypeError:函数最多需要2个参数(给定5个)