Log when echo=true BEGIN/COMMIT/ROLLBACK functions
when using echo=true, we should log begin/commit/rollback as they are important commands to debug transactions
example of debug output with formatter = readable_log_formatter.ReadableFormatter:
DEBUG aiomysql in _execute_command (line:661)
ECHO: b'SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ'
command: 3
DEBUG aiomysql in _execute_command (line:661)
ECHO: b'COMMIT'
command: 3
DEBUG aiomysql in _execute_command (line:661)
ECHO: b'SET AUTOCOMMIT = 0'
command: 3
DEBUG aiomysql in _execute_command (line:661)
ECHO: b'SET AUTOCOMMIT = 1'
command: 3
DEBUG aiomysql in _execute_command (line:661)
ECHO: b"SELECT server_id,account_id,api_key FROM sync_instances WHERE session_id='842d9230-acea-414f-8066-2cfcc392c203;1;15173280'"
command: 3
DEBUG aiocache.base in set (line:268)
SET sync_instances842d9230-acea-414f-8066-2cfcc392c203;1;15173280 1 (0.0001)s
DEBUG aiomysql in _execute_command (line:661)
ECHO: b'COMMIT'
command: 3
example of debug output without formatter and format = format=%(asctime)s - %(name)s - %(levelname)s - %(message)s :
2020-06-13 12:44:53,893 - aiomysql - DEBUG - ECHO: b'SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ'
2020-06-13 12:44:53,893 - aiomysql - DEBUG - ECHO: b'COMMIT'
2020-06-13 12:44:53,894 - aiomysql - DEBUG - ECHO: b'SET AUTOCOMMIT = 0'
2020-06-13 12:44:53,895 - aiomysql - DEBUG - ECHO: b'SET AUTOCOMMIT = 1'
2020-06-13 12:44:53,895 - aiomysql - DEBUG - ECHO: b"SELECT server_id,account_id,api_key FROM sync_instances WHERE session_id='842d9230-acea-414f-8066-2cfcc392c203;1;15173280'"
Hi @webknjaz, I'm new here and don't know if you can help here, but you have some commits =)
Please, when possible check if this PR is usefull
I couldn't debug deadlock without the commit / autocommit / transation isolations / being / rollback messages at connection level, the cursor level is "ok" but not as usefull as this one