aboutsummaryrefslogtreecommitdiffstats
path: root/websocket
diff options
context:
space:
mode:
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