# HG changeset patch # User Marcin Kuzminski # Date 2010-04-19 21:03:01 # Node ID 0c22a870bb79068ce779928c1346c830a20b5f6a # Parent b2c38dee135a63c9289d6af9ec5a9c09a17153d6 logging proxy update diff --git a/pylons_app/lib/timerproxy.py b/pylons_app/lib/timerproxy.py --- a/pylons_app/lib/timerproxy.py +++ b/pylons_app/lib/timerproxy.py @@ -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 @@ class TimerProxy(ConnectionProxy): 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)