From b2744fcf427b2b386dce5e999c855ae5c899e4e2 Mon Sep 17 00:00:00 2001 From: sh0rez Date: Sat, 6 Jul 2019 22:49:08 +0200 Subject: [PATCH] fix(loki): pass missing config error to user Missing config errors are handled at the library level. Our own check mitigated this and causes loki to SEGFAULT later on --- cmd/loki/main.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/loki/main.go b/cmd/loki/main.go index 60676cf3603a..2b1d142f46f4 100644 --- a/cmd/loki/main.go +++ b/cmd/loki/main.go @@ -43,11 +43,9 @@ func main() { util.InitLogger(&cfg.Server) - if configFile != "" { - if err := helpers.LoadConfig(configFile, &cfg); err != nil { - level.Error(util.Logger).Log("msg", "error loading config", "filename", configFile, "err", err) - os.Exit(1) - } + if err := helpers.LoadConfig(configFile, &cfg); err != nil { + level.Error(util.Logger).Log("msg", "error loading config", "filename", configFile, "err", err) + os.Exit(1) } // Re-init the logger which will now honor a different log level set in cfg.Server