diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-07 08:55:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 08:55:43 -0400 |
commit | 51159e7b8325ed45c279d750741e6728e7cf1036 (patch) | |
tree | f38e969a50edc8a6c03311ea7fdb3f58889edb72 /libpod/logs/log.go | |
parent | 0d4a269c6dd06a48d42542d2c0980bf7a51c3493 (diff) | |
parent | 2c79f9929d2434c34205efc1603d51670ed0f763 (diff) | |
download | podman-51159e7b8325ed45c279d750741e6728e7cf1036.tar.gz podman-51159e7b8325ed45c279d750741e6728e7cf1036.tar.bz2 podman-51159e7b8325ed45c279d750741e6728e7cf1036.zip |
Merge pull request #7232 from Luap99/podman-logs-tail
fix podman logs --tail when log is bigger than pagesize
Diffstat (limited to 'libpod/logs/log.go')
-rw-r--r-- | libpod/logs/log.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libpod/logs/log.go b/libpod/logs/log.go index c2545e188..a9554088b 100644 --- a/libpod/logs/log.go +++ b/libpod/logs/log.go @@ -101,11 +101,14 @@ func getTailLog(path string, tail int) ([]*LogLine, error) { if err != nil { if errors.Cause(err) == io.EOF { inputs <- []string{leftover} - close(inputs) - break + } else { + logrus.Error(err) } - logrus.Error(err) close(inputs) + if err := f.Close(); err != nil { + logrus.Error(err) + } + break } line := strings.Split(s+leftover, "\n") if len(line) > 1 { @@ -136,9 +139,6 @@ func getTailLog(path string, tail int) ([]*LogLine, error) { } // if we have enough loglines, we can hangup if nllCounter >= tail { - if err := f.Close(); err != nil { - logrus.Error(err) - } break } } |