Get Output From the logging Module in IPython Notebook

前端 未结 9 1572
悲哀的现实
悲哀的现实 2020-11-30 19:19

When I running the following inside IPython Notebook I don\'t see any output:

import logging
logging.basicConfig(level=logging.DEBUG)
logging.debug(\"test\")         


        
9条回答
  •  自闭症患者
    2020-11-30 19:52

    If you still want to use basicConfig, reload the logging module like this

    from importlib import reload  # Not needed in Python 2
    import logging
    reload(logging)
    logging.basicConfig(format='%(asctime)s %(levelname)s:%(message)s', level=logging.DEBUG, datefmt='%I:%M:%S')
    

提交回复
热议问题