diff options
Diffstat (limited to 'connector')
-rw-r--r-- | connector/external/config.go | 4 | ||||
-rw-r--r-- | connector/external/external.go | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/connector/external/config.go b/connector/external/config.go index bf2a5f8..03e1feb 100644 --- a/connector/external/config.go +++ b/connector/external/config.go @@ -1,6 +1,8 @@ package external import ( + "os" + . "git.deuxfleurs.fr/Deuxfleurs/easybridge/connector" ) @@ -30,7 +32,7 @@ func init() { return &External{ protocol: MESSENGER_PROTOCOL, command: "./external/messenger.py", - debug: true, + debug: (os.Getenv("EASYBRIDGE_MESSENGER_DEBUG") == "true"), } }, Schema: ConfigSchema{ diff --git a/connector/external/external.go b/connector/external/external.go index 553c657..d4a6caf 100644 --- a/connector/external/external.go +++ b/connector/external/external.go @@ -152,12 +152,11 @@ func (ext *External) setupProc(generation int) error { if ext.debug { recv = io.TeeReader(recv, os.Stderr) send = io.MultiWriter(send, os.Stderr) + ext.proc.Stderr = os.Stderr } ext.sendJson = json.NewEncoder(send) - ext.proc.Stderr = os.Stderr - err = ext.proc.Start() if err != nil { return err @@ -250,7 +249,7 @@ func (ext *External) recvLoop(from io.Reader, generation int) { break } - log.Debugf("GOT MESSAGE: %#v %#v", msg, msg.Data) + log.Tracef("GOT MESSAGE: %#v %#v", msg, msg.Data) if strings.HasPrefix(msg.MsgType, "rep_") { func() { ext.lock.Lock() |