diff options
| author | AKP <tom@tdpain.net> | 2022-04-06 19:51:12 +0100 |
|---|---|---|
| committer | AKP <tom@tdpain.net> | 2022-04-06 19:51:12 +0100 |
| commit | e323df861a0f5644a8fd96b26ca421778aa2b0ba (patch) | |
| tree | dec58dd1101ba6047e83c562de7972e82597e3f7 | |
| parent | af45a42d8cc970a541ad66f5c85ead01b6cbde30 (diff) | |
Put debug logs behind the debug flag
Signed-off-by: AKP <tom@tdpain.net>
| -rw-r--r-- | walrss/internal/state/state.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/walrss/internal/state/state.go b/walrss/internal/state/state.go index 087930f..af1d153 100644 --- a/walrss/internal/state/state.go +++ b/walrss/internal/state/state.go @@ -4,6 +4,8 @@ import ( "errors" "fmt" "github.com/kkyr/fig" + "github.com/rs/zerolog" + "github.com/rs/zerolog/log" bh "github.com/timshannon/bolthold" "io/ioutil" "os" @@ -61,6 +63,10 @@ func LoadConfig() (*Config, error) { cfg.Server.ExternalURL = strings.TrimSuffix(cfg.Server.ExternalURL, "/") + if !cfg.Debug { + log.Logger = log.Logger.Level(zerolog.InfoLevel) + } + return cfg, nil } |
