summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-05 15:23:05 +0200
committerGitHub <noreply@github.com>2019-08-05 15:23:05 +0200
commit626dfdb6131a5f37c2f7cc93dbb98f33d495aca4 (patch)
tree1836f259849718606dd0a8af541038d840909dc9 /libpod
parente2f38cdaa41ddc711cce40e00dab9c8457d2e830 (diff)
parent63eef5a23415380bdc3975c90fc88305a0380a61 (diff)
downloadpodman-626dfdb6131a5f37c2f7cc93dbb98f33d495aca4.tar.gz
podman-626dfdb6131a5f37c2f7cc93dbb98f33d495aca4.tar.bz2
podman-626dfdb6131a5f37c2f7cc93dbb98f33d495aca4.zip
Merge pull request #3691 from baude/infoeventlogger
add eventlogger to info
Diffstat (limited to 'libpod')
-rw-r--r--libpod/events/config.go2
-rw-r--r--libpod/events/journal_linux.go5
-rw-r--r--libpod/events/logfile.go5
-rw-r--r--libpod/events/nullout.go8
-rw-r--r--libpod/info.go2
5 files changed, 19 insertions, 3 deletions
diff --git a/libpod/events/config.go b/libpod/events/config.go
index 96172d47b..da1d73013 100644
--- a/libpod/events/config.go
+++ b/libpod/events/config.go
@@ -53,6 +53,8 @@ type Eventer interface {
Write(event Event) error
// Read an event from the backend
Read(options ReadOptions) error
+ // String returns the type of event logger
+ String() string
}
// ReadOptions describe the attributes needed to read event logs
diff --git a/libpod/events/journal_linux.go b/libpod/events/journal_linux.go
index d5bce4334..ae96e3b3b 100644
--- a/libpod/events/journal_linux.go
+++ b/libpod/events/journal_linux.go
@@ -146,3 +146,8 @@ func newEventFromJournalEntry(entry *sdjournal.JournalEntry) (*Event, error) { /
}
return &newEvent, nil
}
+
+// String returns a string representation of the logger
+func (e EventJournalD) String() string {
+ return Journald.String()
+}
diff --git a/libpod/events/logfile.go b/libpod/events/logfile.go
index 30d72b9fc..4b65b0ad0 100644
--- a/libpod/events/logfile.go
+++ b/libpod/events/logfile.go
@@ -71,3 +71,8 @@ func (e EventLogFile) Read(options ReadOptions) error {
close(options.EventChannel)
return nil
}
+
+// String returns a string representation of the logger
+func (e EventLogFile) String() string {
+ return LogFile.String()
+}
diff --git a/libpod/events/nullout.go b/libpod/events/nullout.go
index b11afcf80..f3b36e609 100644
--- a/libpod/events/nullout.go
+++ b/libpod/events/nullout.go
@@ -17,6 +17,10 @@ func (e EventToNull) Read(options ReadOptions) error {
// NewNullEventer returns a new null eventer. You should only do this for
// the purposes on internal libpod testing.
func NewNullEventer() Eventer {
- e := EventToNull{}
- return e
+ return EventToNull{}
+}
+
+// String returns a string representation of the logger
+func (e EventToNull) String() string {
+ return "none"
}
diff --git a/libpod/info.go b/libpod/info.go
index 4a89fa648..9ab6f7e52 100644
--- a/libpod/info.go
+++ b/libpod/info.go
@@ -102,7 +102,7 @@ func (r *Runtime) hostInfo() (map[string]interface{}, error) {
return nil, errors.Wrapf(err, "error getting hostname")
}
info["hostname"] = host
-
+ info["eventlogger"] = r.eventer.String()
return info, nil
}