Flask doesn't print to console

前端 未结 5 1569
生来不讨喜
生来不讨喜 2020-12-28 12:49

I\'m new to flask, and I\'m trying to add print info to debug server side code. When launch my flask app with debug=True, i can\'t get any info print to console

I tr

5条回答
  •  借酒劲吻你
    2020-12-28 13:25

    By default the level for logging is warning. So you won't see a logging message of level DEBUG. To fix this just enable debug logging with the basicConfig() function of the logging module:

    import logging
    logging.basicConfig(level=logging.DEBUG)
    

提交回复
热议问题