5

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.

valanto
  • 893
  • 3
  • 8
  • 23

1 Answers1

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