aboutsummaryrefslogtreecommitdiffstats
path: root/ethrpc
diff options
context:
space:
mode:
Diffstat (limited to 'ethrpc')
-rw-r--r--ethrpc/server.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/ethrpc/server.go b/ethrpc/server.go
index 3960e641c..b55469b83 100644
--- a/ethrpc/server.go
+++ b/ethrpc/server.go
@@ -3,12 +3,14 @@ package ethrpc
import (
"fmt"
"github.com/ethereum/eth-go/ethpub"
- "github.com/ethereum/eth-go/ethutil"
+ "github.com/ethereum/eth-go/ethlog"
"net"
"net/rpc"
"net/rpc/jsonrpc"
)
+var logger = ethlog.NewLogger("JSON")
+
type JsonRpcServer struct {
quit chan bool
listener net.Listener
@@ -25,7 +27,7 @@ out:
}
}
- ethutil.Config.Log.Infoln("[JSON] Shutdown JSON-RPC server")
+ logger.Infoln("Shutdown JSON-RPC server")
}
func (s *JsonRpcServer) Stop() {
@@ -33,7 +35,7 @@ func (s *JsonRpcServer) Stop() {
}
func (s *JsonRpcServer) Start() {
- ethutil.Config.Log.Infoln("[JSON] Starting JSON-RPC server")
+ logger.Infoln("Starting JSON-RPC server")
go s.exitHandler()
rpc.Register(&EthereumApi{ethp: s.ethp})
rpc.HandleHTTP()
@@ -41,10 +43,10 @@ func (s *JsonRpcServer) Start() {
for {
conn, err := s.listener.Accept()
if err != nil {
- ethutil.Config.Log.Infoln("[JSON] Error starting JSON-RPC:", err)
+ logger.Infoln("Error starting JSON-RPC:", err)
break
}
- ethutil.Config.Log.Debugln("[JSON] Incoming request.")
+ logger.Debugln("Incoming request.")
go jsonrpc.ServeConn(conn)
}
}