@@ -6,10 +6,8 @@ package experiments
6
6
7
7
import (
8
8
"context"
9
- "fmt"
10
9
11
10
configcat "github.com/configcat/go-sdk/v7"
12
- "github.com/gitpod-io/gitpod/common-go/log"
13
11
"github.com/sirupsen/logrus"
14
12
)
15
13
@@ -33,28 +31,20 @@ type configCatClient struct {
33
31
client * configcat.Client
34
32
}
35
33
36
- func (c * configCatClient ) GetBoolValue (ctx context.Context , experimentName string , defaultValue bool , attributes Attributes ) bool {
37
- value := c .client .GetBoolValue (experimentName , defaultValue , attributesToUser (attributes ))
38
- log .AddFields (ctx , logField (experimentName , value ))
39
- return value
34
+ func (c * configCatClient ) GetBoolValue (_ context.Context , experimentName string , defaultValue bool , attributes Attributes ) bool {
35
+ return c .client .GetBoolValue (experimentName , defaultValue , attributesToUser (attributes ))
40
36
}
41
37
42
- func (c * configCatClient ) GetIntValue (ctx context.Context , experimentName string , defaultValue int , attributes Attributes ) int {
43
- value := c .client .GetIntValue (experimentName , defaultValue , attributesToUser (attributes ))
44
- log .AddFields (ctx , logField (experimentName , value ))
45
- return value
38
+ func (c * configCatClient ) GetIntValue (_ context.Context , experimentName string , defaultValue int , attributes Attributes ) int {
39
+ return c .client .GetIntValue (experimentName , defaultValue , attributesToUser (attributes ))
46
40
}
47
41
48
- func (c * configCatClient ) GetFloatValue (ctx context.Context , experimentName string , defaultValue float64 , attributes Attributes ) float64 {
49
- value := c .client .GetFloatValue (experimentName , defaultValue , attributesToUser (attributes ))
50
- log .AddFields (ctx , logField (experimentName , value ))
51
- return value
42
+ func (c * configCatClient ) GetFloatValue (_ context.Context , experimentName string , defaultValue float64 , attributes Attributes ) float64 {
43
+ return c .client .GetFloatValue (experimentName , defaultValue , attributesToUser (attributes ))
52
44
}
53
45
54
- func (c * configCatClient ) GetStringValue (ctx context.Context , experimentName string , defaultValue string , attributes Attributes ) string {
55
- value := c .client .GetStringValue (experimentName , defaultValue , attributesToUser (attributes ))
56
- log .AddFields (ctx , logField (experimentName , value ))
57
- return value
46
+ func (c * configCatClient ) GetStringValue (_ context.Context , experimentName string , defaultValue string , attributes Attributes ) string {
47
+ return c .client .GetStringValue (experimentName , defaultValue , attributesToUser (attributes ))
58
48
}
59
49
60
50
func attributesToUser (attributes Attributes ) * configcat.UserData {
@@ -95,9 +85,3 @@ type configCatLogger struct {
95
85
func (l * configCatLogger ) GetLevel () configcat.LogLevel {
96
86
return configcat .LogLevelError
97
87
}
98
-
99
- func logField (experimentName , value interface {}) logrus.Fields {
100
- return logrus.Fields {
101
- fmt .Sprintf ("experiments.%s" , experimentName ): value ,
102
- }
103
- }
0 commit comments