【发布时间】:2021-10-07 16:01:06
【问题描述】:
logger configuration to log to file and print to stdout 不适合我,所以:
我想在控制台中的 prog_log.txt 和中打印日志记录详细信息,我有:
# Debug Settings
Import logging
#logging.disable() #when program ready, un-indent this line to remove all logging messages
logging.basicConfig(level=logging.DEBUG,
filename = 'prog_log.txt',
format='%(asctime)s - %(levelname)s - %(message)s',
filemode = 'w')
logging.debug('Start of Program')
上面确实将日志记录详细信息打印到 prog_log.txt 文件中但控制台上没有任何内容..
In [3]: runfile('/Volumes/GoogleDrive/Mon Drive/MAC_test.py', wdir='/Volumes/GoogleDrive/Mon Drive/')
...nothing...
欢迎任何帮助
【问题讨论】:
-
@JulienSorin 不幸的是,它没有:(我在发布这个问题之前尝试了这个问题