I'd like to log the queries that psycopg2 is making, but the psycopg2 documentation doesn't really specify how LoggingConnection should be used.
import logging
from psycopg2.extras import LoggingConnection
db_settings = {
"user": "abcd",
"password": "efgh",
"host": "postgres.db",
"database": "dev",
}
conn = LoggingConnection(**db_settings)
Gives an error
LoggingConnection(**db_settings) TypeError: function takes at most 2 arguments (5 given)