Skip to content

Commit 1f3d95c

Browse files
committed
moving more logs to trace
1 parent 33a7932 commit 1f3d95c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/github.com/getlantern/fronted/direct.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type direct struct {
4444
}
4545

4646
func Configure(pool *x509.CertPool, masquerades map[string][]*Masquerade, cacheFile string) {
47-
log.Debug("Configuring fronted")
47+
log.Trace("Configuring fronted")
4848
if masquerades == nil || len(masquerades) == 0 {
4949
log.Errorf("No masquerades!!")
5050
return
@@ -103,7 +103,7 @@ func (d *direct) loadCandidates(initial map[string][]*Masquerade) {
103103
}
104104

105105
func (d *direct) vetInitial(numberToVet int) {
106-
log.Debugf("Vetting %d initial candidates in parallel", numberToVet)
106+
log.Tracef("Vetting %d initial candidates in parallel", numberToVet)
107107
for i := 0; i < numberToVet; i++ {
108108
go d.vetOne()
109109
}
@@ -194,26 +194,26 @@ func (d *direct) dialWith(in chan *Masquerade, network string) (net.Conn, bool,
194194
}
195195
}
196196

197-
log.Debugf("Dialing to %v", m)
197+
log.Tracef("Dialing to %v", m)
198198

199199
// We do the full TLS connection here because in practice the domains at a given IP
200200
// address can change frequently on CDNs, so the certificate may not match what
201201
// we expect.
202202
if conn, err := d.dialServerWith(m); err != nil {
203-
log.Debugf("Could not dial to %v, %v", m.IpAddress, err)
203+
log.Tracef("Could not dial to %v, %v", m.IpAddress, err)
204204
// Don't re-add this candidate if it's any certificate error, as that
205205
// will just keep failing and will waste connections. We can't access the underlying
206206
// error at this point so just look for "certificate" and "handshake".
207207
if strings.Contains(err.Error(), "certificate") || strings.Contains(err.Error(), "handshake") {
208-
log.Debugf("Not re-adding candidate that failed on error '%v'", err.Error())
208+
log.Tracef("Not re-adding candidate that failed on error '%v'", err.Error())
209209
} else {
210-
log.Debugf("Unexpected error dialing, keeping masquerade: %v", err)
210+
log.Tracef("Unexpected error dialing, keeping masquerade: %v", err)
211211
retryLater = append(retryLater, m)
212212
}
213213
} else {
214-
log.Debugf("Got successful connection to: %v", m)
214+
log.Tracef("Got successful connection to: %v", m)
215215
if err := d.headCheck(m); err != nil {
216-
log.Debugf("Could not perform successful head request: %v", err)
216+
log.Tracef("Could not perform successful head request: %v", err)
217217
} else {
218218
// Requeue the working connection to masquerades
219219
d.masquerades <- m
@@ -226,14 +226,14 @@ func (d *direct) dialWith(in chan *Masquerade, network string) (net.Conn, bool,
226226
}
227227
idleTimeout := 70 * time.Second
228228

229-
log.Debug("Wrapping connecting in idletiming connection")
229+
log.Trace("Wrapping connecting in idletiming connection")
230230
conn = idletiming.Conn(conn, idleTimeout, func() {
231-
log.Debugf("Connection to %v idle for %v, closing", conn.RemoteAddr(), idleTimeout)
231+
log.Tracef("Connection to %v idle for %v, closing", conn.RemoteAddr(), idleTimeout)
232232
if err := conn.Close(); err != nil {
233-
log.Debugf("Unable to close connection: %v", err)
233+
log.Tracef("Unable to close connection: %v", err)
234234
}
235235
})
236-
log.Debug("Returning connection")
236+
log.Trace("Returning connection")
237237
return conn, true, nil
238238
}
239239
}
@@ -305,7 +305,7 @@ func (d *direct) headCheck(m *Masquerade) error {
305305
if 200 != resp.StatusCode {
306306
return fmt.Errorf("Unexpected response status: %v, %v", resp.StatusCode, resp.Status)
307307
}
308-
log.Debugf("Successfully passed HEAD request through: %v", m)
308+
log.Tracef("Successfully passed HEAD request through: %v", m)
309309
return nil
310310
}
311311

0 commit comments

Comments
 (0)