aboutsummaryrefslogtreecommitdiffstats
path: root/websocket
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-31 19:56:05 +0800
committerobscuren <geffobscura@gmail.com>2014-10-31 19:56:05 +0800
commitb1c247231b11f313ca0eedff75ea563926d23f68 (patch)
tree48b2136cb65e69cb79ffac80f3cc3fdf9dba1cc8 /websocket
parentfd9da72536b73351bbcdc1e9dbbbb8c0e4bfb21b (diff)
downloaddexon-b1c247231b11f313ca0eedff75ea563926d23f68.tar.gz
dexon-b1c247231b11f313ca0eedff75ea563926d23f68.tar.zst
dexon-b1c247231b11f313ca0eedff75ea563926d23f68.zip
ethlog => logger
Diffstat (limited to 'websocket')
-rw-r--r--websocket/client.go8
-rw-r--r--websocket/server.go14
2 files changed, 11 insertions, 11 deletions
diff --git a/websocket/client.go b/websocket/client.go
index 1ff0d3f64..d961816e8 100644
--- a/websocket/client.go
+++ b/websocket/client.go
@@ -73,13 +73,13 @@ func (c *Client) Listen() {
// Listen write request via chanel
func (c *Client) listenWrite() {
- logger.Debugln("Listening write to client")
+ wslogger.Debugln("Listening write to client")
for {
select {
// send message to the client
case msg := <-c.ch:
- logger.Debugln("Send:", msg)
+ wslogger.Debugln("Send:", msg)
ws.JSON.Send(c.ws, msg)
// receive done request
@@ -93,7 +93,7 @@ func (c *Client) listenWrite() {
// Listen read request via chanel
func (c *Client) listenRead() {
- logger.Debugln("Listening read from client")
+ wslogger.Debugln("Listening read from client")
for {
select {
@@ -112,7 +112,7 @@ func (c *Client) listenRead() {
} else if err != nil {
c.server.Err(err)
} else {
- logger.Debugln(&msg)
+ wslogger.Debugln(&msg)
if c.onMessage != nil {
c.onMessage(c, &msg)
}
diff --git a/websocket/server.go b/websocket/server.go
index 1b4c00433..5fd923a0c 100644
--- a/websocket/server.go
+++ b/websocket/server.go
@@ -3,12 +3,12 @@ package websocket
import (
"net/http"
- "github.com/ethereum/go-ethereum/ethlog"
+ "github.com/ethereum/go-ethereum/logger"
ws "code.google.com/p/go.net/websocket"
)
-var logger = ethlog.NewLogger("WS")
+var wslogger = logger.NewLogger("WS")
// Chat server.
type Server struct {
@@ -68,10 +68,10 @@ func (s *Server) Err(err error) {
}
func (s *Server) servHTTP() {
- logger.Debugln("Serving http", s.httpServ)
+ wslogger.Debugln("Serving http", s.httpServ)
err := http.ListenAndServe(s.httpServ, nil)
- logger.Warnln(err)
+ wslogger.Warnln(err)
}
func (s *Server) MessageFunc(f MsgFunc) {
@@ -81,7 +81,7 @@ func (s *Server) MessageFunc(f MsgFunc) {
// Listen and serve.
// It serves client connection and broadcast request.
func (s *Server) Listen() {
- logger.Debugln("Listening server...")
+ wslogger.Debugln("Listening server...")
// ws handler
onConnected := func(ws *ws.Conn) {
@@ -102,7 +102,7 @@ func (s *Server) Listen() {
s := ws.Server{Handler: ws.Handler(onConnected)}
s.ServeHTTP(w, req)
})
- logger.Debugln("Created handler")
+ wslogger.Debugln("Created handler")
go s.servHTTP()
@@ -118,7 +118,7 @@ func (s *Server) Listen() {
delete(s.clients, c.id)
case err := <-s.errCh:
- logger.Debugln("Error:", err.Error())
+ wslogger.Debugln("Error:", err.Error())
case <-s.doneCh:
return