Skip to content

Enable Logging peewee

Enable logging of SQL with peewee

import logging
logger = logging.getLogger('peewee')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)

You can also run ModelSelect.sql()

Source:#