Skip to content

Commit

Permalink
rpc: make debug-level log output less verbose
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Nov 19, 2020
1 parent 7796749 commit 4e776da
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rpc/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,30 @@ package rpc

import (
"net"
"strings"

"github.com/ethereum/go-ethereum/log"
)

// StartIPCEndpoint starts an IPC endpoint.
func StartIPCEndpoint(ipcEndpoint string, apis []API) (net.Listener, *Server, error) {
// Register all the APIs exposed by the services.
handler := NewServer()
var (
handler = NewServer()
regMap = make(map[string]struct{})
registered []string
)
for _, api := range apis {
if err := handler.RegisterName(api.Namespace, api.Service); err != nil {
log.Info("IPC registration failed", "namespace", api.Namespace, "error", err)
return nil, nil, err
}
log.Debug("IPC registered", "namespace", api.Namespace)
if _, ok := regMap[api.Namespace]; !ok {
registered = append(registered, api.Namespace)
regMap[api.Namespace] = struct{}{}
}
}
log.Debug("IPCs registered", "namespaces", strings.Join(registered, ","))
// All APIs registered, start the IPC listener.
listener, err := ipcListen(ipcEndpoint)
if err != nil {
Expand Down

0 comments on commit 4e776da

Please sign in to comment.