Skip to content

Commit

Permalink
Merge pull request #15 from Mixaster995/feature/log-level
Browse files Browse the repository at this point in the history
Added config option for log level
  • Loading branch information
denis-tingaikin authored Oct 9, 2021
2 parents 5332918 + 0468131 commit 06b814d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
type Config struct {
OutputPath string `default:"external_ips.yaml" desc:"Path to writing map of internal to extenrnal ips"`
NodeName string `default:"" desc:"The name of node where application is running"`
LogLevel string `default:"INFO" desc:"Log level" split_words:"true"`
}

func main() {
Expand Down Expand Up @@ -80,6 +81,12 @@ func main() {
logger.Fatalf("error processing rootConf from env: %+v", err)
}

level, err := logrus.ParseLevel(conf.LogLevel)
if err != nil {
logrus.Fatalf("invalid log level %s", conf.LogLevel)
}
logrus.SetLevel(level)

// ********************************************************************************
// Create client-go
// ********************************************************************************
Expand Down

0 comments on commit 06b814d

Please sign in to comment.