1

I would like to see the debug messages for the libraries/modules that I'm using to be displayed along with the debug messages that are present in my code:

app.logger.debug("Print this")

How do I go about it?

codegeek
  • 32,236
  • 12
  • 63
  • 63
Prasoon Joshi
  • 799
  • 8
  • 17

1 Answers1

0

You could probably use logging.basicConfig but recommended way is to handle loggers individually. Here is example from official documentation:

from logging import getLogger
loggers = [app.logger, getLogger('sqlalchemy'),
           getLogger('otherlibrary')]
for logger in loggers:
    logger.addHandler(mail_handler)
    logger.addHandler(file_handler)

You may be also find interesting this: How to configure all loggers in an application

Community
  • 1
  • 1
zero323
  • 322,348
  • 103
  • 959
  • 935