mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fixing log level
This commit is contained in:
9
main.go
9
main.go
@@ -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.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user