diff --git a/cmd/loki/main.go b/cmd/loki/main.go index abea6d2751af5..73368fb43942e 100644 --- a/cmd/loki/main.go +++ b/cmd/loki/main.go @@ -27,7 +27,7 @@ func main() { var config loki.Config if err := cfg.Parse(&config); err != nil { - level.Error(util.Logger).Log("msg", "parsing config", "error", err) + fmt.Fprintf(os.Stderr, "failed parsing config: %v\n", err) os.Exit(1) } if *printVersion { diff --git a/pkg/loki/modules.go b/pkg/loki/modules.go index 8b059fccee35d..cee38c635a49f 100644 --- a/pkg/loki/modules.go +++ b/pkg/loki/modules.go @@ -42,6 +42,15 @@ const ( All ) +func (m *moduleName) UnmarshalYAML(unmarshal func(interface{}) error) error { + var val string + if err := unmarshal(&val); err != nil { + return err + } + + return m.Set(val) +} + func (m moduleName) String() string { switch m { case Ring: