def __write( self, inLogFile, inDate, inMsg ): ############################# # データを作成 wTimeDate = inDate[0] + " " + inDate[1] wSetLine = [] # 2行目以降のブランク文字列 wBlank = " " * len(wTimeDate) # 2行目以降の文字列リスト作成 wMsgLine = inMsg.split('\n') wMsg1 = wMsgLine[0] del wMsgLine[0] wOutLine = "" ############################# # 1行目 wLine = wTimeDate + ' ' + wMsg1 + '\n' wSetLine.append( wLine ) wOutLine = wLine ############################# # 2行目以降 if len(wMsgLine)>0 : for wLine in wMsgLine : wIncLine = wBlank + ' ' + wLine + '\n' wSetLine.append( wIncLine ) wOutLine = wOutLine + wIncLine ############################# # ファイル追加書き込み CLS_File.sAddFile( inLogFile, wSetLine, inExist=False ) wOutLine = wOutLine.strip() return wOutLine
def __testLog(self, inKind, inAccount): ############################# # TestLog有効か if gVal.STR_CronInfo[inKind] != True: ## return #ログ無効 return None #ログ無効 wExeName = inKind.split(".") ############################# # 時間取得 ## wTime = CLS_OSIF.sGetTime() ## wDate = wTime['TimeDate'].split(" ") ## if wDate['Result']!=True : wTime = CLS_OSIF.sGetTime() if wTime['Result'] != True: return None #時間取得失敗 ############################# # パスの生成 ## wDate = wTime['TimeDate'].split(" ") ## wDate = wDate.split("-") wDate = wTime['TimeDate'].split(" ") wDate = wDate[0].split("-") wLogFile = gVal.DEF_STR_FILE['MasterLog_path'] + wDate[0] + wDate[ 1] + "_" + inAccount + ".log" ############################# # 書き込みデータを作成 wSetLine = [] wLine = wTime['TimeDate'] + " cron run: " + inKind + '\n' wSetLine.append(wLine) ############################# # テストログ書き込み ## wLogFile = gVal.STR_CronInfo['Log_path'] + wDate[0] + "_cron" + wExeName[0] + "_" + inAccount + ".log" CLS_File.sAddFile(wLogFile, wSetLine, inExist=False) return wLogFile