当我在终端下面运行代码时,它会创建一个日志文件
import logging
logging.basicConfig(filename='ramexample.log',level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')
Run Code Online (Sandbox Code Playgroud)
但是当我在pycharm中运行相同的代码(使用不同的filename ='ram.log')时,它不会创建任何日志文件.为什么?
import logging
logging.basicConfig(filename='ram.log',level=logging.DEBUG)
logging.debug('This message should go to the log file')
logging.info('So should this')
logging.warning('And this, too')
Run Code Online (Sandbox Code Playgroud)
我需要做什么来创建pycharm的日志文件?