任何人都可以帮助我添加内存处理程序,缓冲处理程序以使我的程序最佳(刷新缓冲内存)。
import logging
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)#we can set deug_level at logger level also
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
ch.setFormatter(formatter)
logger.addHandler(ch)
logger.debug('This is a test log message.')