Skip to content

Commit

Permalink
fix: use correct logger
Browse files Browse the repository at this point in the history
  • Loading branch information
sh0rez committed Sep 26, 2019
1 parent 0082dcb commit 4b11ee8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions cmd/loki/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"flag"
"fmt"
"log"
"os"
"reflect"

Expand All @@ -28,7 +27,8 @@ func main() {

var config loki.Config
if err := cfg.Parse(&config); err != nil {
log.Fatalln(err)
level.Error(util.Logger).Log("msg", "parsing config", "error", err)
os.Exit(1)
}
if *printVersion {
fmt.Print(version.Print("loki"))
Expand All @@ -39,7 +39,8 @@ func main() {
// call it atleast once, the defaults are set to an empty struct.
// We call it with the flag values so that the config file unmarshalling only overrides the values set in the config.
if _, err := validation.NewOverrides(config.LimitsConfig); err != nil {
log.Fatalln(err)
level.Error(util.Logger).Log("msg", "setting up overrides", "error", err)
os.Exit(1)
}

// Init the logger which will honor the log level set in config.Server
Expand Down
4 changes: 2 additions & 2 deletions cmd/promtail/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"flag"
"fmt"
"log"
"os"
"reflect"

Expand All @@ -28,7 +27,8 @@ func main() {

var config config.Config
if err := cfg.Parse(&config); err != nil {
log.Fatalln(err)
level.Error(util.Logger).Log("msg", "parsing config", "error", err)
os.Exit(1)
}
if *printVersion {
fmt.Print(version.Print("promtail"))
Expand Down

0 comments on commit 4b11ee8

Please sign in to comment.