Fix SQL statements logging
Open
enhancement
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
I suggest to remove weird `echo` flag because it's behavior is confusing. There is similar flag in SQLAlchemy for instance and it's behavior is the following: "if you don't want to setup your own logging, then specify `echo=True` and library will add handler for internal logger which outputs logs automatically, but if you setup loggers manually, then you don't need `echo` flag and logging just works" (https://github.com/sqlalchemy/sqlalchemy/blob/4aadcca993ce30c25b09679178907991b4430b2e/lib/sqlalchemy/log.py#L94-L97).
In case of `aiopg` it's simply:
https://github.com/aio-libs/aiopg/blob/57b5d55b3593ed6c6d8507d33a8bf1e0300fce84/aiopg/cursor.py#L109-L111
Contributor guide
Assessment
This issue has not been assessed yet.