Skip to content

Commit

Permalink
Fix appconfig loading (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: aalexandru <aalexand@adobe.com>
  • Loading branch information
aalexandru and aalexandru authored Jun 1, 2023
1 parent 583c75a commit 4d1d7bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions cmd/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ var Version = "dev"
func main() {

appConfig, err := config.LoadApiConfig()
log.SetLevel(appConfig.LogLevel)

if err != nil {
log.Fatalf("Cannot load the api configuration: '%v'", err.Error())
} else {
log.Debugf("Config loaded successfully %+v:", appConfig)
}
log.SetLevel(appConfig.LogLevel)
log.Debugf("Config loaded successfully %+v:", appConfig)

m := monitoring.NewMetrics("cluster_registry_api", false)
db := database.NewDb(appConfig, m)
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func LoadApiConfig() (*AppConfig, error) {
}

logLevel := log.WARN
configLogLevel := getEnv("LOG_LEVEL", "")
configLogLevel := getEnv("LOG_LEVEL", "INFO")
if configLogLevel == "DEBUG" {
logLevel = log.DEBUG
} else if configLogLevel == "INFO" {
Expand Down

0 comments on commit 4d1d7bc

Please sign in to comment.