blob: d6898145ce05990ad40c02afab23abe214ed7519 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
}
|