logging.info doesn't show up on console but warn and error do

前端 未结 3 1761
慢半拍i
慢半拍i 2021-01-30 19:29

When I log an event with logging.info, it doesn\'t appear in the Python terminal.

import logging
logging.info(\'I am info\')  # no output

3条回答
  •  失恋的感觉
    2021-01-30 19:59

    Like @ztyx said that default logger level is WARNING. You have to set it to a lower level

    You can do it by using logging.basicConfig and setting logger level:

    logging.basicConfig(level=logging.DEBUG)
    

提交回复
热议问题