# HG changeset patch # User Marcin Kuzminski # Date 1271710981 -7200 # Node ID 0c22a870bb79068ce779928c1346c830a20b5f6a # Parent b2c38dee135a63c9289d6af9ec5a9c09a17153d6 logging proxy update diff -r b2c38dee135a -r 0c22a870bb79 pylons_app/lib/timerproxy.py --- a/pylons_app/lib/timerproxy.py Mon Apr 19 22:55:58 2010 +0200 +++ b/pylons_app/lib/timerproxy.py Mon Apr 19 23:03:01 2010 +0200 @@ -1,7 +1,7 @@ from sqlalchemy.interfaces import ConnectionProxy import time import logging -log = logging.getLogger(__name__) +log = logging.getLogger('timerproxy') class TimerProxy(ConnectionProxy): def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): @@ -11,5 +11,8 @@ return execute(cursor, statement, parameters, context) finally: total = time.time() - now - log.info("Query: %s" % statement % parameters) + try: + log.info("Query: %s" % statement % parameters) + except TypeError: + log.info("Query: %s %s" % (statement, parameters)) log.info("<<<<< TOTAL TIME: %f <<<<<" % total)