Skip to content

Commit

Permalink
feat: Logger levels
Browse files Browse the repository at this point in the history
  • Loading branch information
wolmi committed Oct 5, 2023
1 parent 1adc0bd commit e63859f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ func initConfig() {

// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
fmt.Fprintln(os.Stdout, "Using config file:", viper.ConfigFileUsed())
}
}
2 changes: 2 additions & 0 deletions types/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ func (p *Proxy) Init(ctx context.Context) {
logLevel := viper.GetBool("debug")
if logLevel {
p.echo.Logger.SetLevel(log.DEBUG)
} else {
p.echo.Logger.SetLevel(log.INFO)
}

p.echo.GET("/", func(c echo.Context) error {
Expand Down

0 comments on commit e63859f

Please sign in to comment.