Logging config

This commit is contained in:
simon987
2019-01-14 18:37:05 -05:00
parent ef333b6b25
commit 0346dd8b6b
7 changed files with 22 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
package config
import (
"github.com/Sirupsen/logrus"
"github.com/spf13/viper"
)
@@ -10,6 +11,7 @@ var Cfg struct {
WebHookSecret []byte
WebHookHash string
WebHookSigHeader string
LogLevel logrus.Level
}
func SetupConfig() {
@@ -27,4 +29,5 @@ func SetupConfig() {
Cfg.WebHookSecret = []byte(viper.GetString("git.webhook_secret"))
Cfg.WebHookHash = viper.GetString("git.webhook_hash")
Cfg.WebHookSigHeader = viper.GetString("git.webhook_sig_header")
Cfg.LogLevel, _ = logrus.ParseLevel(viper.GetString("log.level"))
}