fixing log level

This commit is contained in:
Pedro Nasser
2016-08-01 19:32:34 -03:00
parent dfc4be9861
commit d223abecd7

View File

@@ -16,7 +16,6 @@ import (
"github.com/iron-io/functions/api/datastore"
"github.com/iron-io/functions/api/models"
"github.com/iron-io/functions/api/server"
"github.com/iron-io/titan/common"
"github.com/spf13/viper"
)
@@ -24,9 +23,13 @@ func main() {
config := &models.Config{}
InitConfig()
common.SetLogLevel(viper.GetString("log_level"))
logLevel, err := log.ParseLevel(viper.GetString("log_level"))
if err != nil {
log.WithError(err).Fatalln("Invalid log level.")
}
log.SetLevel(logLevel)
err := config.Validate()
err = config.Validate()
if err != nil {
log.WithError(err).Fatalln("Invalid config.")
}