From dbc5109058c9b406e0ef175003ed81cd131b4299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 17 Mar 2022 11:08:50 +0100 Subject: [PATCH] Manager: reduce logging of configuration service --- internal/manager/config/settings.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/manager/config/settings.go b/internal/manager/config/settings.go index 449d8508..d2234781 100644 --- a/internal/manager/config/settings.go +++ b/internal/manager/config/settings.go @@ -183,7 +183,7 @@ func getConf() (Conf, error) { func DefaultConfig() Conf { c := defaultConfig c.Meta.Version = latestConfigVersion - c.constructVariableLookupTable() + c.constructVariableLookupTable(zerolog.TraceLevel) return c } @@ -221,7 +221,7 @@ func loadConf(filename string) (Conf, error) { return c, fmt.Errorf("unable to parse %s: %w", filename, err) } - c.constructVariableLookupTable() + c.constructVariableLookupTable(zerolog.DebugLevel) c.parseURLs() c.checkDatabase() c.checkVariables() @@ -230,7 +230,7 @@ func loadConf(filename string) (Conf, error) { return c, nil } -func (c *Conf) constructVariableLookupTable() { +func (c *Conf) constructVariableLookupTable(logLevel zerolog.Level) { lookup := map[VariableAudience]map[string]map[string]string{} // Construct a list of all audiences except "" and "all" @@ -242,7 +242,7 @@ func (c *Conf) constructVariableLookupTable() { } concreteAudiences = append(concreteAudiences, audience) } - log.Debug(). + log.Trace(). Interface("concreteAudiences", concreteAudiences). Interface("isWildcard", isWildcard). Msg("constructing variable lookup table") @@ -263,7 +263,7 @@ func (c *Conf) constructVariableLookupTable() { if lookup[audience][platform] == nil { lookup[audience][platform] = map[string]string{} } - log.Debug(). + log.Trace(). Str("audience", string(audience)). Str("platform", platform). Str("name", name). @@ -274,7 +274,7 @@ func (c *Conf) constructVariableLookupTable() { // Construct the lookup table for each audience+platform+name for name, variable := range c.Variables { - log.Debug(). + log.WithLevel(logLevel). Str("name", name). Interface("variable", variable). Msg("handling variable") @@ -303,7 +303,7 @@ func (c *Conf) constructVariableLookupTable() { } } } - log.Debug(). + log.Trace(). Interface("variables", c.Variables). Interface("lookup", lookup). Msg("constructed lookup table")