Log SQL of queries in when log level set to debug mode
This patch was authored and released by @0xTim.
Brings back logging when the log level is set to debug mode for queries. Will print the SQL and any binds depending on the queries being executed.