Logging setLevel is being ignored

前端 未结 6 1183
我寻月下人不归
我寻月下人不归 2020-12-03 00:15

The below code is copied from the documentation. I am supposed to be able to see all the info logs. But I don\'t. I am only able to see the warn and above even though I\'ve

6条回答
  •  天命终不由人
    2020-12-03 01:17

    The accepted answer does not work for me on Win10, Python 3.7.2.

    My solution:

    logging.basicConfig(level=logging.DEBUG)
    logger = logging.getLogger(__name__)
    logger.setLevel(logging.DEBUG)
    

    It's order sensitive.

提交回复
热议问题