Skip to content

Commit

Permalink
fix: print feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Oct 20, 2023
1 parent 9f7a860 commit 1f2409f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ func Initialize(baseCtx context.Context) context.Context {
auth.InitializeAuth()
jobs.InitializeJobs(ctx)
validation.InitializeVirusTotal()
util.PrintFeatureFlags()

return ctx
}
Expand Down
11 changes: 10 additions & 1 deletion util/flags.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package util

import "github.com/spf13/viper"
import (
"github.com/rs/zerolog/log"
"github.com/spf13/viper"
)

type FeatureFlag string

Expand All @@ -11,3 +14,9 @@ const (
func FlagEnabled(flag FeatureFlag) bool {
return viper.GetBool("feature_flags." + string(flag))
}

func PrintFeatureFlags() {
for _, flag := range []FeatureFlag{FeatureFlagAllowMultiTargetUpload} {
log.Info().Str("flag", string(flag)).Bool("enabled", FlagEnabled(flag)).Msg("flag")
}
}

0 comments on commit 1f2409f

Please sign in to comment.