Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
manav2401 committed Oct 12, 2023
1 parent 5e325d7 commit d60fae5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions eth/protocols/eth/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package eth
import (
"errors"
"fmt"
"runtime"
"time"

"github.com/ethereum/go-ethereum/log"
Expand Down Expand Up @@ -64,6 +65,17 @@ func (r *Request) Close() error {
return nil
}

// Get function caller details
pc, file, no, ok := runtime.Caller(1)
details := runtime.FuncForPC(pc)
if ok {
extra := ""
if details != nil {
extra = details.Name()
}
log.Info("***** request.Close() called from", "file", fmt.Sprintf("%s#%d", file, no), "name", extra)
}

cancelOp := &cancel{
id: r.id,
fail: make(chan error),
Expand Down
2 changes: 1 addition & 1 deletion eth/protocols/eth/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func handleGetBlockHeaders66(backend Backend, msg Decoder, peer *Peer) error {

err := peer.ReplyBlockHeadersRLP(query.RequestId, response)

log.Info("***** Returning from handleGetBlockHeaders66", "response", response, "err", err)
log.Info("***** Returning from handleGetBlockHeaders66", "response.length", len(response), "err", err)

return err
}
Expand Down

0 comments on commit d60fae5

Please sign in to comment.