Logging basicConfig not creating log file when i run in pycharm?

前端 未结 6 565
醉话见心
醉话见心 2020-12-29 03:34

When i run below code in terminal its create a log file

import logging 
logging.basicConfig(filename=\'ramexample.log\',level=logging.DEBUG)
logging.debug(\         


        
6条回答
  •  Happy的楠姐
    2020-12-29 04:28

    This does create a log within the pycharm terminal using the Py terminal within it. You need to check the location of where the terminal is (try dir on Windows or pwd on linux/mac). Instead of just putting in ram.log, use the full file path of where you would like the file to appear. E.G.

    logging.basicConfig(filename='/Users/Donkey/Test/ram.log', level=logging.DEBUG)
    

提交回复
热议问题