Skip to content

Commit 4496194

Browse files
committed
Add diagnostic logging for feature flag parsing
This helps diagnose issues where feature flags may not be recognized, such as build caching problems or initialization ordering issues. Signed-off-by: Davanum Srinivas <[email protected]>
1 parent 704f239 commit 4496194

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/featureflag/featureflag.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ func ParseFlags(f string) {
158158
defer flagsMutex.Unlock()
159159

160160
f = strings.TrimSpace(f)
161+
var parsed, unknown int
161162
for _, s := range strings.Split(f, ",") {
162163
s = strings.TrimSpace(s)
163164
if s == "" {
@@ -176,10 +177,15 @@ func ParseFlags(f string) {
176177
if ff != nil {
177178
klog.Infof("FeatureFlag %q=%v", ff.Key, enabled)
178179
ff.enabled = &enabled
180+
parsed++
179181
} else {
180182
klog.Infof("Unknown FeatureFlag %q", s)
183+
unknown++
181184
}
182185
}
186+
if f != "" {
187+
klog.Infof("ParseFlags: parsed %d flags from %q (unknown=%d, registered=%d)", parsed, f, unknown, len(flags))
188+
}
183189
}
184190

185191
// Get returns given FeatureFlag.

0 commit comments

Comments
 (0)