Skip to content

Commit

Permalink
fix(loki): pass missing config error to user
Browse files Browse the repository at this point in the history
Missing config errors are handled at the library level. Our own check mitigated
this and causes loki to SEGFAULT later on
  • Loading branch information
sh0rez committed Jul 6, 2019
1 parent 1c95a5b commit b2744fc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/loki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2744fc

Please sign in to comment.