diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-11-16 22:26:58 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-11-16 22:26:58 -0800 |
| commit | 6c9156b25f8b1c28fb0cc909310a20aeeec0e087 (patch) | |
| tree | 343e30d98e46a081aa57adfc334b807d0b3255dc /weed/util/config.go | |
| parent | 9add554feb53706d1d878cc9636d234e622b8a80 (diff) | |
| download | seaweedfs-origin/logrus.tar.xz seaweedfs-origin/logrus.zip | |
switch to logrusorigin/logrus
losing filename and line number. Critical for debugging.
Diffstat (limited to 'weed/util/config.go')
| -rw-r--r-- | weed/util/config.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/util/config.go b/weed/util/config.go index 6acf21c12..9d7552064 100644 --- a/weed/util/config.go +++ b/weed/util/config.go @@ -5,7 +5,7 @@ import ( "github.com/spf13/viper" - "github.com/chrislusf/seaweedfs/weed/glog" + "github.com/chrislusf/seaweedfs/weed/util/log" ) type Configuration interface { @@ -24,16 +24,16 @@ func LoadConfiguration(configFileName string, required bool) (loaded bool) { viper.AddConfigPath("$HOME/.seaweedfs") // call multiple times to add many search paths viper.AddConfigPath("/etc/seaweedfs/") // path to look for the config file in - glog.V(1).Infof("Reading %s.toml from %s", configFileName, viper.ConfigFileUsed()) + log.Debugf("Reading %s.toml from %s", configFileName, viper.ConfigFileUsed()) if err := viper.MergeInConfig(); err != nil { // Handle errors reading the config file - logLevel := glog.Level(0) if strings.Contains(err.Error(), "Not Found") { - logLevel = 1 + log.Warnf("Reading %s: %v", viper.ConfigFileUsed(), err) + } else { + log.Infof("Reading %s: %v", viper.ConfigFileUsed(), err) } - glog.V(logLevel).Infof("Reading %s: %v", viper.ConfigFileUsed(), err) if required { - glog.Fatalf("Failed to load %s.toml file from current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/"+ + log.Fatalf("Failed to load %s.toml file from current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/"+ "\n\nPlease use this command to generate the default %s.toml file\n"+ " weed scaffold -config=%s -output=.\n\n\n", configFileName, configFileName, configFileName) |
