summaryrefslogtreecommitdiffstats
path: root/bridge/config
diff options
context:
space:
mode:
authorDuco van Amstel <duco.vanamstel@gmail.com>2018-12-26 15:16:09 +0100
committerWim <wim@42.be>2018-12-26 15:16:09 +0100
commitda8e415ae1fb899df4fb05a8a81934e205fb4765 (patch)
treefca9a1b2b26c9971cf0e21e8e53ac8014cd77ccf /bridge/config
parent1b834c6858d6fdb8927f6a75fad2116d6d2bd394 (diff)
downloadmatterbridge-msglm-da8e415ae1fb899df4fb05a8a81934e205fb4765.tar.gz
matterbridge-msglm-da8e415ae1fb899df4fb05a8a81934e205fb4765.tar.bz2
matterbridge-msglm-da8e415ae1fb899df4fb05a8a81934e205fb4765.zip
Use logrus imports instead of log (#662)
Diffstat (limited to 'bridge/config')
-rw-r--r--bridge/config/config.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/bridge/config/config.go b/bridge/config/config.go
index eb34912d..b32db7da 100644
--- a/bridge/config/config.go
+++ b/bridge/config/config.go
@@ -9,7 +9,7 @@ import (
"github.com/fsnotify/fsnotify"
prefixed "github.com/matterbridge/logrus-prefixed-formatter"
- log "github.com/sirupsen/logrus"
+ "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
@@ -197,12 +197,12 @@ type config struct {
}
func NewConfig(cfgfile string) Config {
- log.SetFormatter(&prefixed.TextFormatter{PrefixPadding: 13, DisableColors: true, FullTimestamp: false})
- flog := log.WithFields(log.Fields{"prefix": "config"})
+ logrus.SetFormatter(&prefixed.TextFormatter{PrefixPadding: 13, DisableColors: true, FullTimestamp: false})
+ flog := logrus.WithFields(logrus.Fields{"prefix": "config"})
viper.SetConfigFile(cfgfile)
input, err := getFileContents(cfgfile)
if err != nil {
- log.Fatal(err)
+ logrus.Fatal(err)
}
mycfg := newConfigFromString(input)
if mycfg.cv.General.MediaDownloadSize == 0 {
@@ -218,7 +218,7 @@ func NewConfig(cfgfile string) Config {
func getFileContents(filename string) ([]byte, error) {
input, err := ioutil.ReadFile(filename)
if err != nil {
- log.Fatal(err)
+ logrus.Fatal(err)
return []byte(nil), err
}
return input, nil
@@ -236,13 +236,13 @@ func newConfigFromString(input []byte) *config {
viper.AutomaticEnv()
err := viper.ReadConfig(bytes.NewBuffer(input))
if err != nil {
- log.Fatal(err)
+ logrus.Fatal(err)
}
cfg := &BridgeValues{}
err = viper.Unmarshal(cfg)
if err != nil {
- log.Fatal(err)
+ logrus.Fatal(err)
}
return &config{
v: viper.GetViper(),