def setLogFilePath(self, LogFilePath, bSaveToOptions=False): if (bSaveToOptions): AutologOpt.setFilePath(LogFilePath) BugOptions.write() if (not LogFilePath or LogFilePath == "Default"): LogFilePath = BugPath.findOrMakeDir("Autolog") self.LogFilePath = LogFilePath self.updateLogFile()
def openSDFile(self): szPath = BugAutolog.getFilePath() if (not szPath or szPath == "Default"): szPath = BugPath.findOrMakeDir("Autolog") if (not os.path.isdir(szPath)): os.makedirs(szPath) szFile = os.path.join(szPath, self.FileName) self.SDFile = codecs.open(szFile, 'a', 'utf-8') BugConfigTracker.add("SDFile_Log", szFile)
def openFile(self, bForce=False, sWrite='a'): if (self.HoldOpen and not bForce): return szPath = BugFile.getFilePath() if (not szPath or szPath == "Default"): szPath = BugPath.findOrMakeDir("Autolog") if (not os.path.isdir(szPath)): os.makedirs(szPath) szFile = os.path.join(szPath, self.FileName) self.File = codecs.open(szFile, sWrite, 'utf-8') BugConfigTracker.add("Autolog_Log", szFile)