summaryrefslogtreecommitdiff
path: root/libpod/events/events_freebsd.go
blob: 90933fa2cc586953be62d322a4d8da447c0e1ebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package events

import (
	"fmt"
	"strings"

	"github.com/sirupsen/logrus"
)

// NewEventer creates an eventer based on the eventer type
func NewEventer(options EventerOptions) (Eventer, error) {
	logrus.Debugf("Initializing event backend %s", options.EventerType)
	switch strings.ToUpper(options.EventerType) {
	case strings.ToUpper(LogFile.String()):
		return EventLogFile{options}, nil
	case strings.ToUpper(Null.String()):
		return newNullEventer(), nil
	case strings.ToUpper(Memory.String()):
		return NewMemoryEventer(), nil
	default:
		return nil, fmt.Errorf("unknown event logger type: %s", strings.ToUpper(options.EventerType))
	}
}