summaryrefslogtreecommitdiff
path: root/libpod/events/events_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/events/events_linux.go')
-rw-r--r--libpod/events/events_linux.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/libpod/events/events_linux.go b/libpod/events/events_linux.go
new file mode 100644
index 000000000..d6898145c
--- /dev/null
+++ b/libpod/events/events_linux.go
@@ -0,0 +1,20 @@
+package events
+
+import (
+ "github.com/pkg/errors"
+ "strings"
+)
+
+// NewEventer creates an eventer based on the eventer type
+func NewEventer(options EventerOptions) (Eventer, error) {
+ var eventer Eventer
+ switch strings.ToUpper(options.EventerType) {
+ case strings.ToUpper(Journald.String()):
+ eventer = EventJournalD{options}
+ case strings.ToUpper(LogFile.String()):
+ eventer = EventLogFile{options}
+ default:
+ return eventer, errors.Errorf("unknown event logger type: %s", strings.ToUpper(options.EventerType))
+ }
+ return eventer, nil
+}