Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix SQL statements logging #522

Open
decaz opened this issue Dec 21, 2018 · 1 comment
Open

Fix SQL statements logging #522

decaz opened this issue Dec 21, 2018 · 1 comment
Labels

Comments

@decaz
Copy link

@decaz decaz commented Dec 21, 2018

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:

aiopg/aiopg/cursor.py

Lines 109 to 111 in 57b5d55

if self._echo:
logger.info(operation)
logger.info("%r", parameters)

@aio-libs-bot
Copy link

@aio-libs-bot aio-libs-bot commented Dec 21, 2018

GitMate.io thinks possibly related issues are #78 (SQL statements logging), #13 (Process cancellation of sql request), #388 (Add Logging When Pool is full), #18 (Fix a bug in connection pool), and #14 (Fix a bug in aiopg pool).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.