From 3b2d69dde3ae175bf00981e0d95e7e8cafd5f3a1 Mon Sep 17 00:00:00 2001
From: sunty <1172534965@qq.com>
Date: 星期二, 27 七月 2021 14:45:29 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/pubsub/esutil

---
 .gitignore  |    3 +++
 EsClient.go |    2 ++
 swfs.go     |    7 +++----
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cedd413
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+.idea
+go.mod
+go.sum
\ No newline at end of file
diff --git a/EsClient.go b/EsClient.go
index d8c9db5..0395fd3 100644
--- a/EsClient.go
+++ b/EsClient.go
@@ -1104,6 +1104,8 @@
 	v := viper.New()
 	v.SetConfigType("yaml")
 	v.SetConfigName("pro")
+	v.AddConfigPath("../config/")
+	v.AddConfigPath("./config/")
 	v.AddConfigPath("/opt/vasystem/config/")
 	err := v.ReadInConfig()
 	if err != nil {
diff --git a/swfs.go b/swfs.go
index d3a9b39..179cc75 100644
--- a/swfs.go
+++ b/swfs.go
@@ -5,7 +5,6 @@
 	"bytes"
 	"errors"
 	"fmt"
-	"github.com/golang/glog"
 	"io"
 	"io/ioutil"
 	"net/http"
@@ -60,7 +59,7 @@
 	cp := configPath + "/seaweedfs_start.sh"
 	file, err := os.OpenFile(cp, os.O_RDWR, 0666)
 	if err != nil {
-		glog.Error("open config file fail, err: ", err)
+		fmt.Println("open config file fail, err: ", err)
 		return info, err
 	}
 	defer file.Close()
@@ -102,7 +101,7 @@
 	cp := configPath + "/seaweedfs_start.sh"
 	file, err := os.OpenFile(cp, os.O_RDWR, 0666)
 	if err != nil {
-		glog.Error("open config file fail, err: ", err)
+		fmt.Println("open config file fail, err: ", err)
 		return false
 	}
 	defer file.Close()
@@ -131,7 +130,7 @@
 	}
 
 	if err := writeToFile(cp, output); err != nil {
-		glog.Errorf("write config file err: %v", err)
+		fmt.Println("write config file err: ", err)
 		return false
 	}
 	return true

--
Gitblit v1.8.0