Is there a way or setting in Peewee where I can get it to print out all the queries being executed in order to debug and understand potential performance issues.
Asked
Active
Viewed 2,468 times
1 Answers
11
Yes, it is documented: http://docs.peewee-orm.com/en/latest/peewee/database.html#logging-queries
# Print all queries to stderr.
import logging
logger = logging.getLogger('peewee')
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler())

coleifer
- 24,887
- 6
- 60
- 75