Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Luiz Aoqui <luiz@hashicorp.com>
  • Loading branch information
jrasell and lgfa29 authored Mar 28, 2023
1 parent 1d0f33b commit 2f10f25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions command/alloc_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (l *AllocLogsCommand) Run(args []string) int {
// In order to run the mixed log output, we can only follow the files from
// their current positions. There is no way to interleave previous log
// lines as there is no timestamp references.
if !l.stderr && !l.stdout && l.follow && !l.tail && l.numLines < 0 && l.numBytes < 0 {
if l.follow && !(l.stderr || l.stdout || l.tail || l.numLines > 0 || l.numBytes > 0) {
if err := l.tailMultipleFiles(client, alloc); err != nil {
l.Ui.Error(fmt.Sprintf("Failed to tail stdout and stderr files: %v", err))
return 1
Expand Down Expand Up @@ -398,7 +398,7 @@ func (l *AllocLogsCommand) tailMultipleFiles(client *api.Client, alloc *api.Allo
case stdoutErr := <-stdoutErrCh:
return fmt.Errorf("received an error from stdout log stream: %v", stdoutErr)
case stdoutFrame := <-stdoutFrames:
logUI.Info(string(stdoutFrame.Data))
logUI.Output(string(stdoutFrame.Data))
case stderrErr := <-stderrErrCh:
return fmt.Errorf("received an error from stderr log stream: %v", stderrErr)
case stderrFrame := <-stderrFrames:
Expand Down

0 comments on commit 2f10f25

Please sign in to comment.