aboutsummaryrefslogtreecommitdiff
path: root/weed/util/config.go
diff options
context:
space:
mode:
authorhilimd <68371223+hilimd@users.noreply.github.com>2020-10-26 22:01:50 +0800
committerGitHub <noreply@github.com>2020-10-26 22:01:50 +0800
commit843865f2ca534bb6286b7a3d79c436384d875608 (patch)
tree653943fe04caf3fe607416715fb341460a624ab7 /weed/util/config.go
parentcf7a1c722fa82fa78c546f68e4814fff7dc6d1e2 (diff)
parent44921220b01d21c64755cbc7560ff8932f71984d (diff)
downloadseaweedfs-843865f2ca534bb6286b7a3d79c436384d875608.tar.xz
seaweedfs-843865f2ca534bb6286b7a3d79c436384d875608.zip
Merge pull request #33 from chrislusf/master
sync
Diffstat (limited to 'weed/util/config.go')
-rw-r--r--weed/util/config.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/weed/util/config.go b/weed/util/config.go
index 7b6e92f08..6acf21c12 100644
--- a/weed/util/config.go
+++ b/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())
if err := viper.MergeInConfig(); err != nil { // Handle errors reading the config file
- glog.V(1).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 {
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"+