Fixed xds-common version and use last one
[src/xds/xds-agent.git] / lib / syncthing / st.go
index 8fd50d3..a750036 100644 (file)
@@ -17,8 +17,8 @@ import (
        "os/exec"
 
        "github.com/Sirupsen/logrus"
-       "github.com/iotbzh/xds-agent/lib/common"
        "github.com/iotbzh/xds-agent/lib/xdsconfig"
+       common "github.com/iotbzh/xds-common/golib"
        "github.com/syncthing/syncthing/lib/config"
 )
 
@@ -170,7 +170,6 @@ func (s *SyncThing) Start() (*exec.Cmd, error) {
        env := []string{
                "STNODEFAULTFOLDER=1",
                "STNOUPGRADE=1",
-               "STNORESTART=1",
        }
 
        // XXX - temporary hack because -gui-apikey seems to correctly handle by
@@ -185,7 +184,7 @@ func (s *SyncThing) Start() (*exec.Cmd, error) {
                        time.Sleep(500 * time.Millisecond)
                        if common.Exists(stConfigFile) {
                                break
-       }
+                       }
                }
                if tmo <= 0 {
                        return nil, fmt.Errorf("Cannot start Syncthing for config file creation")
@@ -301,7 +300,9 @@ func (s *SyncThing) Connect() error {
                return fmt.Errorf("ERROR: cannot connect to Syncthing (null client)")
        }
 
-       s.client.SetLogger(s.log)
+       s.client.SetLogLevel(s.log.Level.String())
+       s.client.LoggerPrefix = "SYNCTHING: "
+       s.client.LoggerOut = s.log.Out
 
        return nil
 }