9
9
10
10
type Attributes map [string ]interface {}
11
11
12
- // Client for eppo.cloud. Instance of this struct will be created on calling InitClient.
12
+ // EppoClient Client for eppo.cloud. Instance of this struct will be created on calling InitClient.
13
13
// EppoClient will then immediately start polling experiments data from Eppo.
14
14
type EppoClient struct {
15
15
configurationStore * configurationStore
@@ -42,7 +42,7 @@ func (ec *EppoClient) GetBoolAssignment(flagKey string, subjectKey string, subje
42
42
}
43
43
result , ok := variation .(bool )
44
44
if ! ok {
45
- ec .applicationLogger .Error ("failed to cast %v to bool" , variation )
45
+ ec .applicationLogger .Errorf ("failed to cast %v to bool" , variation )
46
46
return defaultValue , fmt .Errorf ("failed to cast %v to bool" , variation )
47
47
}
48
48
return result , err
@@ -55,7 +55,7 @@ func (ec *EppoClient) GetNumericAssignment(flagKey string, subjectKey string, su
55
55
}
56
56
result , ok := variation .(float64 )
57
57
if ! ok {
58
- ec .applicationLogger .Error ("failed to cast %v to float64" , variation )
58
+ ec .applicationLogger .Errorf ("failed to cast %v to float64" , variation )
59
59
return defaultValue , fmt .Errorf ("failed to cast %v to float64" , variation )
60
60
}
61
61
return result , err
@@ -68,7 +68,7 @@ func (ec *EppoClient) GetIntegerAssignment(flagKey string, subjectKey string, su
68
68
}
69
69
result , ok := variation .(int64 )
70
70
if ! ok {
71
- ec .applicationLogger .Error ("failed to cast %v to int64" , variation )
71
+ ec .applicationLogger .Errorf ("failed to cast %v to int64" , variation )
72
72
return defaultValue , fmt .Errorf ("failed to cast %v to int64" , variation )
73
73
}
74
74
return result , err
@@ -81,7 +81,7 @@ func (ec *EppoClient) GetStringAssignment(flagKey string, subjectKey string, sub
81
81
}
82
82
result , ok := variation .(string )
83
83
if ! ok {
84
- ec .applicationLogger .Error ("failed to cast %v to string" , variation )
84
+ ec .applicationLogger .Errorf ("failed to cast %v to string" , variation )
85
85
return defaultValue , fmt .Errorf ("failed to cast %v to string" , variation )
86
86
}
87
87
return result , err
@@ -110,7 +110,7 @@ func (ec *EppoClient) GetBanditAction(flagKey string, subjectKey string, subject
110
110
variation = defaultVariation
111
111
}
112
112
113
- // If no acctions have been passed, we will return the variation, even if it is a bandit key
113
+ // If no actions have been passed, we will return the variation, even if it is a bandit key
114
114
if len (actions ) == 0 {
115
115
return BanditResult {
116
116
Variation : variation ,
@@ -192,19 +192,19 @@ func (ec *EppoClient) getAssignment(config configuration, flagKey string, subjec
192
192
193
193
flag , err := config .getFlagConfiguration (flagKey )
194
194
if err != nil {
195
- ec .applicationLogger .Info ("failed to get flag configuration: %v" , err )
195
+ ec .applicationLogger .Infof ("failed to get flag configuration: %v" , err )
196
196
return nil , err
197
197
}
198
198
199
199
err = flag .verifyType (variationType )
200
200
if err != nil {
201
- ec .applicationLogger .Info ("failed to verify flag type: %v" , err )
201
+ ec .applicationLogger .Warnf ("failed to verify flag type: %v" , err )
202
202
return nil , err
203
203
}
204
204
205
205
assignmentValue , assignmentEvent , err := flag .eval (subjectKey , subjectAttributes , ec .applicationLogger )
206
206
if err != nil {
207
- ec .applicationLogger .Info ("failed to evaluate flag: %v" , err )
207
+ ec .applicationLogger .Errorf ("failed to evaluate flag: %v" , err )
208
208
return nil , err
209
209
}
210
210
@@ -214,7 +214,7 @@ func (ec *EppoClient) getAssignment(config configuration, flagKey string, subjec
214
214
defer func () {
215
215
r := recover ()
216
216
if r != nil {
217
- ec .applicationLogger .Error ("panic occurred: %v" , r )
217
+ ec .applicationLogger .Errorf ("panic occurred: %v" , r )
218
218
}
219
219
}()
220
220
0 commit comments