fix logging of resolving scopes (#50173)

This commit is contained in:
Yuriy Tseretyan 2022-06-03 10:53:53 -04:00 committed by GitHub
parent 67290aa49f
commit c85567f490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ func (s *ScopeResolvers) GetScopeAttributeMutator(orgID int64) ScopeAttributeMut
// Check cache before computing the scope
if cachedScope, ok := s.cache.Get(key); ok {
scopes := cachedScope.([]string)
s.log.Debug("used cache to resolve '%v' to '%v'", scope, scopes)
s.log.Debug("used cache to resolve scope", "scope", scope, "resolved_scopes", scopes)
return scopes, nil
}
@ -53,7 +53,7 @@ func (s *ScopeResolvers) GetScopeAttributeMutator(orgID int64) ScopeAttributeMut
}
// Cache result
s.cache.Set(key, scopes, ttl)
s.log.Debug("resolved '%v' to '%v'", scope, scopes)
s.log.Debug("resolved scope", "scope", scope, "resolved_scopes", scopes)
return scopes, nil
}
return []string{scope}, nil
@ -67,7 +67,7 @@ func (s *ScopeResolvers) GetScopeKeywordMutator(user *models.SignedInUser) Scope
if err != nil {
return "", fmt.Errorf("could not resolve %v: %w", scope, err)
}
s.log.Debug("resolved '%v' to '%v'", scope, scopes)
s.log.Debug("resolved scope", "scope", scope, "resolved_scopes", scopes)
return scopes, nil
}
// By default, the scope remains unchanged