Skip to content

Commit

Permalink
chore: use constant for debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterSchafer committed Aug 2, 2024
1 parent 7c1af04 commit 3501d99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cliv2/cmd/cliv2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func initApplicationConfiguration(config configuration.Configuration) {
config.AddAlternativeKeys(configuration.ANALYTICS_DISABLED, []string{strings.ToLower(constants.SNYK_ANALYTICS_DISABLED_ENV), "snyk_cfg_disable_analytics", "disable-analytics", "disable_analytics"})
config.AddAlternativeKeys(configuration.ORGANIZATION, []string{"snyk_cfg_org"})
config.AddAlternativeKeys(configuration.PREVIEW_FEATURES_ENABLED, []string{"snyk_preview"})
config.AddAlternativeKeys("snyk_log_level", []string{debug_level_flag})
config.AddAlternativeKeys(configuration.LOG_LEVEL, []string{debug_level_flag})

// if the CONFIG_KEY_OAUTH_TOKEN is specified as env var, we don't apply any additional logic
_, ok := os.LookupEnv(auth.CONFIG_KEY_OAUTH_TOKEN)
Expand Down
2 changes: 1 addition & 1 deletion cliv2/internal/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func GetDebugLevel(config configuration.Configuration) zerolog.Level {
if config.GetBool(configuration.DEBUG) {
loglevel = zerolog.DebugLevel

if loglevelString := config.GetString("snyk_log_level"); loglevelString != "" {
if loglevelString := config.GetString(configuration.LOG_LEVEL); loglevelString != "" {
var err error
loglevel, err = zerolog.ParseLevel(loglevelString)
if err != nil {
Expand Down

0 comments on commit 3501d99

Please sign in to comment.