@@ -2,6 +2,7 @@ package query
22
33import (
44 "errors"
5+ "fmt"
56 "time"
67
78 "github.com/btcsuite/btcd/wire"
@@ -43,6 +44,12 @@ func (q *queryJob) Index() uint64 {
4344 return q .index
4445}
4546
47+ // String returns the string representation of the queryJob code.
48+ func (q * queryJob ) String () string {
49+ return fmt .Sprintf ("QueryJob(index=%v): tries=%v, timeout=%v, +" +
50+ "request_msg: %v" , q .index , q .tries , q .timeout , q .Req )
51+ }
52+
4653// jobResult is the final result of the worker's handling of the queryJob.
4754type jobResult struct {
4855 job * queryJob
@@ -96,7 +103,7 @@ func (w *worker) Run(results chan<- *jobResult, quit <-chan struct{}) {
96103 select {
97104 // Poll a new job from the nextJob channel.
98105 case job = <- w .nextJob :
99- log .Tracef ("Worker %v picked up job with index %v" ,
106+ log .Infof ("Worker %v picked up job with index %v" ,
100107 peer .Addr (), job .Index ())
101108
102109 // Ignore any message received while not working on anything.
@@ -154,7 +161,7 @@ func (w *worker) Run(results chan<- *jobResult, quit <-chan struct{}) {
154161 job .Req , resp , peer .Addr (),
155162 )
156163
157- log .Tracef ("Worker %v handled msg %T while " +
164+ log .Infof ("Worker %v handled msg %T while " +
158165 "waiting for response to %T (job=%v). " +
159166 "Finished=%v, progressed=%v" ,
160167 peer .Addr (), resp , job .Req , job .Index (),
@@ -189,7 +196,7 @@ func (w *worker) Run(results chan<- *jobResult, quit <-chan struct{}) {
189196 // The query did experience a timeout and will
190197 // be given to someone else.
191198 jobErr = ErrQueryTimeout
192- log .Tracef ("Worker %v timeout for request %T " +
199+ log .Infof ("Worker %v timeout for request %T " +
193200 "with job index %v" , peer .Addr (),
194201 job .Req , job .Index ())
195202
0 commit comments