Skip to content

Commit

Permalink
remove get log line
Browse files Browse the repository at this point in the history
  • Loading branch information
F1bonacc1 committed Jul 20, 2023
1 parent 1809c0d commit 2d99334
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
10 changes: 1 addition & 9 deletions src/app/project_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,6 @@ func (p *ProjectRunner) GetProcessLog(name string, offsetFromEnd, limit int) ([]
return logs.GetLogRange(offsetFromEnd, limit), nil
}

func (p *ProjectRunner) GetProcessLogLine(name string, lineIndex int) (string, error) {
logs, err := p.getProcessLog(name)
if err != nil {
return "", err
}
return logs.GetLogLine(lineIndex), nil
}

func (p *ProjectRunner) GetProcessLogLength(name string) int {
logs, err := p.getProcessLog(name)
if err != nil {
Expand Down Expand Up @@ -528,7 +520,7 @@ func (p *ProjectRunner) selectRunningProcessesNoDeps(procList []string) error {
for _, procName := range procList {
if conf, ok := p.project.Processes[procName]; ok {
conf.DependsOn = types.DependsOnConfig{}
newProcMap[procName] = conf
newProcMap[conf.ReplicaName] = conf
} else {
err := fmt.Errorf("no such process: %s", procName)
log.Err(err).Msgf("Failed select processes")
Expand Down
16 changes: 0 additions & 16 deletions src/pclog/process_log_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@ func (b *ProcessLogBuffer) GetLogRange(offsetFromEnd, limit int) []string {
return b.buffer[len(b.buffer)-offsetFromEnd : offsetFromEnd+limit]
}

func (b *ProcessLogBuffer) GetLogLine(lineIndex int) string {
if len(b.buffer) == 0 {
return ""
}

if lineIndex >= len(b.buffer) {
lineIndex = len(b.buffer) - 1
}

if lineIndex < 0 {
lineIndex = 0
}

return b.buffer[lineIndex]
}

func (b *ProcessLogBuffer) GetLogLength() int {
return len(b.buffer)
}
Expand Down

0 comments on commit 2d99334

Please sign in to comment.