aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syncthing
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-06 18:08:05 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 15:57:03 +0100
commit76b949fbfca5a80d990048791ac1258fc8bb027d (patch)
tree7abdf6f7f3e1d077f62696b564e93bc21eeb0dda /lib/syncthing
parent0e72ccd733207877bd8edca55fd6aed0877139e5 (diff)
Fix syncthing logger
Diffstat (limited to 'lib/syncthing')
-rw-r--r--lib/syncthing/st.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go
index e8e9f44..b14f40d 100644
--- a/lib/syncthing/st.go
+++ b/lib/syncthing/st.go
@@ -316,7 +316,12 @@ func (s *SyncThing) Connect() error {
common.HTTPClientConfig{
URLPrefix: "/rest",
HeaderClientKeyName: "X-Syncthing-ID",
+ LogOut: s.conf.LogVerboseOut,
+ LogPrefix: "SYNCTHING: ",
+ LogLevel: common.HTTPLogLevelWarning,
})
+ s.client.SetLogLevel(s.log.Level.String())
+
if err != nil {
msg := ": " + err.Error()
if strings.Contains(err.Error(), "connection refused") {
@@ -328,11 +333,6 @@ func (s *SyncThing) Connect() error {
return fmt.Errorf("ERROR: cannot connect to Syncthing (null client)")
}
- // Redirect HTTP log into a file
- s.client.SetLogLevel(s.conf.Log.Level.String())
- s.client.LoggerPrefix = "SYNCTHING: "
- s.client.LoggerOut = s.conf.LogVerboseOut
-
s.MyID, err = s.IDGet()
if err != nil {
return fmt.Errorf("ERROR: cannot retrieve ID")