summaryrefslogtreecommitdiff
path: root/libpod/events/events.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/events/events.go')
-rw-r--r--libpod/events/events.go21
1 files changed, 7 insertions, 14 deletions
diff --git a/libpod/events/events.go b/libpod/events/events.go
index 2cdd2ab67..1745095fb 100644
--- a/libpod/events/events.go
+++ b/libpod/events/events.go
@@ -3,11 +3,9 @@ package events
import (
"encoding/json"
"fmt"
- "os"
"time"
"github.com/containers/storage/pkg/stringid"
- "github.com/nxadm/tail"
"github.com/pkg/errors"
)
@@ -87,7 +85,11 @@ func (e *Event) ToHumanReadable(truncate bool) string {
case Image:
humanFormat = fmt.Sprintf("%s %s %s %s %s", e.Time, e.Type, e.Status, id, e.Name)
case System:
- humanFormat = fmt.Sprintf("%s %s %s", e.Time, e.Type, e.Status)
+ if e.Name != "" {
+ humanFormat = fmt.Sprintf("%s %s %s %s", e.Time, e.Type, e.Status, e.Name)
+ } else {
+ humanFormat = fmt.Sprintf("%s %s %s", e.Time, e.Type, e.Status)
+ }
case Volume:
humanFormat = fmt.Sprintf("%s %s %s %s", e.Time, e.Type, e.Status, e.Name)
}
@@ -196,6 +198,8 @@ func StringToStatus(name string) (Status, error) {
return Restart, nil
case Restore.String():
return Restore, nil
+ case Rotate.String():
+ return Rotate, nil
case Save.String():
return Save, nil
case Start.String():
@@ -215,14 +219,3 @@ func StringToStatus(name string) (Status, error) {
}
return "", errors.Errorf("unknown event status %q", name)
}
-
-func (e EventLogFile) getTail(options ReadOptions) (*tail.Tail, error) {
- reopen := true
- seek := tail.SeekInfo{Offset: 0, Whence: os.SEEK_END}
- if options.FromStart || !options.Stream {
- seek.Whence = 0
- reopen = false
- }
- stream := options.Stream
- return tail.TailFile(e.options.LogFilePath, tail.Config{ReOpen: reopen, Follow: stream, Location: &seek, Logger: tail.DiscardingLogger, Poll: true})
-}