python 日志
def initial_log(self, fileName, logName, level=logging.INFO, fileSize=1024):
handler = RotatingFileHandler(fileName + '.log', maxBytes=1 * fileSize * 1024, backupCount=5)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
self.logger = logging.getLogger(logName)
self.logger.setLevel(level)
self.logger.addHandler(handler)