discosrv: Clean up debug logging

This commit is contained in:
Jakob Borg
2014-04-16 15:06:54 +02:00
parent 1bf128612d
commit 116203aef8
2 changed files with 8 additions and 5 deletions

View File

@@ -131,7 +131,7 @@ func (d *Discoverer) sendExternalAnnouncements() {
for errCounter < maxErrors {
if debug {
dlog.Println("send announcement -> ", remote)
dlog.Printf("send announcement -> %v\n%s", remote, hex.Dump(buf))
}
_, err = conn.WriteTo(buf, remote)
if err != nil {
@@ -140,6 +140,11 @@ func (d *Discoverer) sendExternalAnnouncements() {
} else {
errCounter = 0
}
if debug {
time.Sleep(1 * time.Second)
res := d.externalLookup(d.MyID)
dlog.Println("external lookup check:", res)
}
time.Sleep(d.ExtBroadcastIntv)
}
log.Printf("discover/write: %v: stopping due to too many errors: %v", remote, err)