Skip to content

Commit

Permalink
[common-go] fix incorrect log level (#19083)
Browse files Browse the repository at this point in the history
  • Loading branch information
iQQBot authored Nov 16, 2023
1 parent a290b8b commit bde844b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 4 additions & 0 deletions components/common-go/experiments/configcat.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func (l *configCatLogger) GetLevel() configcat.LogLevel {
return configcat.LogLevelError
}

func (l *configCatLogger) Debugf(format string, args ...interface{}) {}
func (l *configCatLogger) Infof(format string, args ...interface{}) {}
func (l *configCatLogger) Warnf(format string, args ...interface{}) {}

func logField(experimentName, value interface{}) logrus.Fields {
return logrus.Fields{
fmt.Sprintf("experiments.%s", experimentName): value,
Expand Down
5 changes: 1 addition & 4 deletions components/common-go/experiments/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (

configcat "github.com/configcat/go-sdk/v7"
"github.com/gitpod-io/gitpod/common-go/log"
"github.com/sirupsen/logrus"
)

type Client interface {
Expand Down Expand Up @@ -90,13 +89,11 @@ func NewClient(opts ...ClientOpt) Client {
}
return NewAlwaysReturningDefaultValueClient()
}
logger := log.Log.Dup()
logger.Logger.SetLevel(logrus.ErrorLevel)
return newConfigCatClient(configcat.Config{
SDKKey: opt.sdkKey,
BaseURL: opt.baseURL,
PollInterval: opt.pollInterval,
HTTPTimeout: 3 * time.Second,
Logger: &configCatLogger{logger},
Logger: &configCatLogger{log.Log},
})
}

0 comments on commit bde844b

Please sign in to comment.