Show More
@@ -1,7 +1,7 b'' | |||||
1 | from sqlalchemy.interfaces import ConnectionProxy |
|
1 | from sqlalchemy.interfaces import ConnectionProxy | |
2 | import time |
|
2 | import time | |
3 | import logging |
|
3 | import logging | |
4 |
log = logging.getLogger( |
|
4 | log = logging.getLogger('timerproxy') | |
5 |
|
5 | |||
6 | class TimerProxy(ConnectionProxy): |
|
6 | class TimerProxy(ConnectionProxy): | |
7 | def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): |
|
7 | def cursor_execute(self, execute, cursor, statement, parameters, context, executemany): | |
@@ -11,5 +11,8 b' class TimerProxy(ConnectionProxy):' | |||||
11 | return execute(cursor, statement, parameters, context) |
|
11 | return execute(cursor, statement, parameters, context) | |
12 | finally: |
|
12 | finally: | |
13 | total = time.time() - now |
|
13 | total = time.time() - now | |
14 | log.info("Query: %s" % statement % parameters) |
|
14 | try: | |
|
15 | log.info("Query: %s" % statement % parameters) | |||
|
16 | except TypeError: | |||
|
17 | log.info("Query: %s %s" % (statement, parameters)) | |||
15 | log.info("<<<<< TOTAL TIME: %f <<<<<" % total) |
|
18 | log.info("<<<<< TOTAL TIME: %f <<<<<" % total) |
General Comments 0
You need to be logged in to leave comments.
Login now