Ejemplo n.º 1
0
func initLogFile(logDir string) {
	// initial directory
	initDir(logDir)
	// exit log file
	exitLog = newLogger(logDir + "/phase2_exitLog")
	// progress log file
	progressLog = record.NewAnnularLog(logDir + "/phase2_progresslog")
	// error log file
	errLog = record.NewSequenceLog(logDir + "/phase2_errorLog")
}
Ejemplo n.º 2
0
func initRecordFile(recordPath string) {
	// init record file
	recordFile = record.NewSequenceLog(recordPath)
	// get formatted last record in progress log
	index := progressLog.LastIndex()
	var i int64 = 0
	for i = 0; i < index; i++ {
		if _, err := recordFile.Readln(); err != nil {
			exitLog.Println(err)
			panic(err)
		}
	}
}