Browse Source

adjust log level

pull/1560/head
Chris Lu 4 years ago
parent
commit
5b92dfe302
  1. 6
      weed/util/config.go

6
weed/util/config.go

@ -27,7 +27,11 @@ func LoadConfiguration(configFileName string, required bool) (loaded bool) {
glog.V(1).Infof("Reading %s.toml from %s", configFileName, viper.ConfigFileUsed()) glog.V(1).Infof("Reading %s.toml from %s", configFileName, viper.ConfigFileUsed())
if err := viper.MergeInConfig(); err != nil { // Handle errors reading the config file if err := viper.MergeInConfig(); err != nil { // Handle errors reading the config file
glog.V(0).Infof("Reading %s: %v", viper.ConfigFileUsed(), err)
logLevel := glog.Level(0)
if strings.Contains(err.Error(), "Not Found") {
logLevel = 1
}
glog.V(logLevel).Infof("Reading %s: %v", viper.ConfigFileUsed(), err)
if required { if required {
glog.Fatalf("Failed to load %s.toml file from current directory, or $HOME/.seaweedfs/, or /etc/seaweedfs/"+ glog.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"+ "\n\nPlease use this command to generate the default %s.toml file\n"+

Loading…
Cancel
Save