@@ -49,13 +49,13 @@ type Client struct {
49
49
// ClientLogger is the interface that must be implemented by a logger
50
50
// to be used in the discovery client.
51
51
type ClientLogger interface {
52
- Infof (format string , args ... interface {})
52
+ Debugf (format string , args ... interface {})
53
53
Errorf (format string , args ... interface {})
54
54
}
55
55
56
56
type nullClientLogger struct {}
57
57
58
- func (l * nullClientLogger ) Infof (format string , args ... interface {}) {}
58
+ func (l * nullClientLogger ) Debugf (format string , args ... interface {}) {}
59
59
func (l * nullClientLogger ) Errorf (format string , args ... interface {}) {}
60
60
61
61
type discoveryMessage struct {
@@ -132,7 +132,7 @@ func (disc *Client) jsonDecodeLoop(in io.Reader, outChan chan<- *discoveryMessag
132
132
if err != nil {
133
133
disc .logger .Errorf ("Stopped decode loop: %v" , err )
134
134
} else {
135
- disc .logger .Infof ("Stopped decode loop" )
135
+ disc .logger .Debugf ("Stopped decode loop" )
136
136
}
137
137
}
138
138
@@ -146,7 +146,7 @@ func (disc *Client) jsonDecodeLoop(in io.Reader, outChan chan<- *discoveryMessag
146
146
closeAndReportError (err )
147
147
return
148
148
}
149
- disc .logger .Infof ("Received message %s" , msg )
149
+ disc .logger .Debugf ("Received message %s" , msg )
150
150
if msg .EventType == "add" {
151
151
if msg .Port == nil {
152
152
closeAndReportError (errors .New ("invalid 'add' message: missing port" ))
@@ -193,7 +193,7 @@ func (disc *Client) waitMessage(timeout time.Duration) (*discoveryMessage, error
193
193
}
194
194
195
195
func (disc * Client ) sendCommand (command string ) error {
196
- disc .logger .Infof ("Sending command %s" , strings .TrimSpace (command ))
196
+ disc .logger .Debugf ("Sending command %s" , strings .TrimSpace (command ))
197
197
data := []byte (command )
198
198
for {
199
199
n , err := disc .outgoingCommandsPipe .Write (data )
@@ -208,7 +208,7 @@ func (disc *Client) sendCommand(command string) error {
208
208
}
209
209
210
210
func (disc * Client ) runProcess () error {
211
- disc .logger .Infof ("Starting discovery process" )
211
+ disc .logger .Debugf ("Starting discovery process" )
212
212
proc , err := paths .NewProcess (nil , disc .processArgs ... )
213
213
if err != nil {
214
214
return err
@@ -234,15 +234,15 @@ func (disc *Client) runProcess() error {
234
234
disc .statusMutex .Lock ()
235
235
defer disc .statusMutex .Unlock ()
236
236
disc .process = proc
237
- disc .logger .Infof ("Discovery process started" )
237
+ disc .logger .Debugf ("Discovery process started" )
238
238
return nil
239
239
}
240
240
241
241
func (disc * Client ) killProcess () {
242
242
disc .statusMutex .Lock ()
243
243
defer disc .statusMutex .Unlock ()
244
244
245
- disc .logger .Infof ("Killing discovery process" )
245
+ disc .logger .Debugf ("Killing discovery process" )
246
246
if process := disc .process ; process != nil {
247
247
disc .process = nil
248
248
if err := process .Kill (); err != nil {
@@ -252,7 +252,7 @@ func (disc *Client) killProcess() {
252
252
disc .logger .Errorf ("Waiting discovery process termination: %v" , err )
253
253
}
254
254
}
255
- disc .logger .Infof ("Discovery process killed" )
255
+ disc .logger .Debugf ("Discovery process killed" )
256
256
}
257
257
258
258
// Run starts the discovery executable process and sends the HELLO command to the discovery to agree on the
0 commit comments