+import logging
+logging.basicConfig(level=logging.INFO)
+logger = logging.getLogger(__name__)
+
class Base(object):
- def query(self, sql):
+ def query(self, sql, placeholders):
res = None
cur = self.conn.cursor()
try:
- cur.execute(sql)
+ cur.execute(sql, placeholders)
res = cur.fetchall()
- except:
+ except Exception as e:
+ logger.error("{0}".format(e))
pass
finally:
cur.close()