summaryrefslogtreecommitdiff
path: root/libpod/logs/log.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-31 22:05:17 +0100
committerGitHub <noreply@github.com>2019-10-31 22:05:17 +0100
commit2dae2577ccbeef502a8783c892a6c9e346153532 (patch)
tree34bc708c058597eb0e9c82f4cdbc6e308d6b4497 /libpod/logs/log.go
parent0bfdeae6ddfab22990eaa472317d65e79a222db3 (diff)
parent11750df51015a675c1145982847e08397c7606ea (diff)
downloadpodman-2dae2577ccbeef502a8783c892a6c9e346153532.tar.gz
podman-2dae2577ccbeef502a8783c892a6c9e346153532.tar.bz2
podman-2dae2577ccbeef502a8783c892a6c9e346153532.zip
Merge pull request #4399 from giuseppe/tail-0
logs: support --tail 0
Diffstat (limited to 'libpod/logs/log.go')
-rw-r--r--libpod/logs/log.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/logs/log.go b/libpod/logs/log.go
index 0b1703567..0330df06a 100644
--- a/libpod/logs/log.go
+++ b/libpod/logs/log.go
@@ -31,7 +31,7 @@ type LogOptions struct {
Details bool
Follow bool
Since time.Time
- Tail uint64
+ Tail int64
Timestamps bool
Multi bool
WaitGroup *sync.WaitGroup
@@ -54,8 +54,10 @@ func GetLogFile(path string, options *LogOptions) (*tail.Tail, []*LogLine, error
logTail []*LogLine
)
// whence 0=origin, 2=end
- if options.Tail > 0 {
+ if options.Tail >= 0 {
whence = 2
+ }
+ if options.Tail > 0 {
logTail, err = getTailLog(path, int(options.Tail))
if err != nil {
return nil, nil, err