log.pyide
1 import logging 2 from logs import ResultFolder 3 4 logger = logging.getLogger() 5 logger.setLevel(logging.DEBUG) 6 7 def CreateLoggerFile(filename): 8 try: 9 fulllogname = ResultFolder.GetRunDirectory()+'\\logs' + "\\"+filename+".log" 10 fh = logging.FileHandler(fulllogname) 11 fh.setLevel(logging.DEBUG) 12 formatter = logging.Formatter('%(asctime)s [line:%(lineno)d] %(message)s') 13 fh.setFormatter(formatter) 14 logger.addHandler(fh) 15 except Exception as err: 16 logger.debug("Error when creating log file, error message:{}".format(str(err))) 17 18 def Log(message): 19 logger.debug(message)
log測試
不斷完善中。。。優化
plan:spa
1.生成結果報告debug
2.用例優化日誌
3.用例集篩選執行code