aboutsummaryrefslogtreecommitdiffstats
path: root/ethrpc
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-23 19:54:10 +0800
committerzelig <viktor.tron@gmail.com>2014-06-23 19:54:10 +0800
commitb9e8a3e02493d5bbf23cfcab259e66f6ae166612 (patch)
tree63a13e2d4bfb3daf0a9b06b32b8ef8b849556781 /ethrpc
parent8e9cc3697944c3e568186a5c23ac729f6eb4a1f4 (diff)
downloaddexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.tar
dexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.tar.gz
dexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.tar.bz2
dexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.tar.lz
dexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.tar.xz
dexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.tar.zst
dexon-b9e8a3e02493d5bbf23cfcab259e66f6ae166612.zip
modified logging API
- package vars for tagged loggers - weed out spurious fmt.PrintX and log.PrintX logging - tried to second guess loglevel for some :)
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)
}
}