Skip to content

Commit

Permalink
Make log level configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
xperimental committed Jul 1, 2019
1 parent 6dd209d commit 5e35716
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ var (
)

func main() {
if logLevelStr := os.Getenv("LOG_LEVEL"); logLevelStr != "" {
logLevel, err := logrus.ParseLevel(logLevelStr)
if err != nil {
log.Fatalf("Invalid log level %q: %s", logLevelStr, err)
}

log.SetLevel(logLevel)
}

config, err := parseConfig()
if err != nil {
log.Fatalf("Error in configuration: %s", err)
Expand Down

0 comments on commit 5e35716

Please sign in to comment.