| @@ -572,6 +572,11 @@ func CloudbrainGetLog(ctx *context.APIContext) { | |||||
| startLine = 0 | startLine = 0 | ||||
| } | } | ||||
| } | } | ||||
| } else { | |||||
| if startLine > 0 { | |||||
| startLine += 1 | |||||
| endLine += 1 | |||||
| } | |||||
| } | } | ||||
| result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath) | result = getLogFromModelDir(job.JobName, startLine, endLine, resultPath) | ||||
| if result == nil { | if result == nil { | ||||
| @@ -723,6 +728,7 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s | |||||
| re = re + line | re = re + line | ||||
| count++ | count++ | ||||
| } | } | ||||
| fileEndLine = i + 1 | |||||
| log.Info("read file completed.") | log.Info("read file completed.") | ||||
| break | break | ||||
| } | } | ||||
| @@ -732,13 +738,12 @@ func getLogFromModelDir(jobName string, startLine int, endLine int, resultPath s | |||||
| } | } | ||||
| if error == nil { | if error == nil { | ||||
| if i >= startLine { | if i >= startLine { | ||||
| fileEndLine = i | |||||
| fileEndLine = i + 1 | |||||
| re = re + line | re = re + line | ||||
| count++ | count++ | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| fileEndLine = fileEndLine + 1 | |||||
| } else { | } else { | ||||
| log.Info("error:" + err.Error()) | log.Info("error:" + err.Error()) | ||||
| } | } | ||||