Debug queries properly.
authorCMDR furrycat <elite@furrycat.net>
Fri, 21 Oct 2016 07:21:26 +0000 (08:21 +0100)
committerCMDR furrycat <elite@furrycat.net>
Fri, 21 Oct 2016 07:21:26 +0000 (08:21 +0100)
db.py

diff --git a/db.py b/db.py
index 5226f9f..d38b972 100644 (file)
--- a/db.py
+++ b/db.py
@@ -46,7 +46,7 @@ class DBConnection(object):
   def query(self, sql, params = ()):
     if self.dbh is None:
       self.open_db()
-    log.debug(sql, params)
+    log.debug(sql.replace('?', '{}').format(*params))
     cursor = self.dbh.cursor()
     cursor.execute(sql, params)
     return cursor