diff options
author | obscuren <geffobscura@gmail.com> | 2014-06-27 01:52:31 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-06-27 01:52:31 +0800 |
commit | 491925b71ef3431d2acd8cd0c639d90c9ae0cb2d (patch) | |
tree | 8e86c3aa0f913288f2a789c3517444e6fe0583b9 /ethrpc | |
parent | 0ed19d9f2024744ba93d0e34db6939766b3cfed5 (diff) | |
parent | 853053a3b204ddf4ae935e70e0aa5b5d8994493e (diff) | |
download | go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.tar go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.tar.gz go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.tar.bz2 go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.tar.lz go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.tar.xz go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.tar.zst go-tangerine-491925b71ef3431d2acd8cd0c639d90c9ae0cb2d.zip |
Merge branch 'ethersphere-feature/logging' into develop
Diffstat (limited to 'ethrpc')
-rw-r--r-- | ethrpc/packages.go | 2 | ||||
-rw-r--r-- | ethrpc/server.go | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/ethrpc/packages.go b/ethrpc/packages.go index 3f57f6982..710275780 100644 --- a/ethrpc/packages.go +++ b/ethrpc/packages.go @@ -184,7 +184,7 @@ func (p *EthereumApi) GetStorageAt(args *GetStorageArgs, reply *string) error { i, _ := new(big.Int).SetString(args.Key, 10) hx = ethutil.Hex(i.Bytes()) } - ethutil.Config.Log.Debugf("[JSON] GetStorageAt(%s, %s)\n", args.Address, hx) + logger.Debugf("GetStorageAt(%s, %s)\n", args.Address, hx) value := state.GetStorage(hx) *reply = NewSuccessRes(GetStorageAtRes{Address: args.Address, Key: args.Key, Value: value}) return nil diff --git a/ethrpc/server.go b/ethrpc/server.go index 3960e641c..d9d6f695b 100644 --- a/ethrpc/server.go +++ b/ethrpc/server.go @@ -2,13 +2,15 @@ package ethrpc import ( "fmt" + "github.com/ethereum/eth-go/ethlog" "github.com/ethereum/eth-go/ethpub" - "github.com/ethereum/eth-go/ethutil" "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) } } |