mirror of
https://github.com/containers/podman
synced 2024-10-20 17:23:30 +00:00
d1fc3fc702
If the systemd development files are not present on the system which builds podman, then `podman events` will error on runtime creation. Beside this, a warning will be printed when compiling podman. This commit mainly exists because projects which depend on libpod would not need the podman event support and therefore do not need to rely on the systemd headers. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
26 lines
715 B
Go
26 lines
715 B
Go
package events
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/pkg/errors"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
// NewEventer creates an eventer based on the eventer type
|
|
func NewEventer(options EventerOptions) (eventer Eventer, err error) {
|
|
logrus.Debugf("Initializing event backend %s", options.EventerType)
|
|
switch strings.ToUpper(options.EventerType) {
|
|
case strings.ToUpper(Journald.String()):
|
|
eventer, err = newEventJournalD(options)
|
|
if err != nil {
|
|
return nil, errors.Wrapf(err, "eventer creation")
|
|
}
|
|
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
|
|
}
|