From 8ecec9b49dd159c2eb42e3d6ada023cf0981a278 Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 17 Aug 2016 23:12:10 +0200 Subject: [PATCH] format log --- transport/internet/ws/dialer.go | 4 ++-- transport/internet/ws/hub.go | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/transport/internet/ws/dialer.go b/transport/internet/ws/dialer.go index 41b2bac5..0d4f0844 100644 --- a/transport/internet/ws/dialer.go +++ b/transport/internet/ws/dialer.go @@ -17,7 +17,7 @@ var ( ) func Dial(src v2net.Address, dest v2net.Destination) (internet.Connection, error) { - log.Info("Dailing WS to ", dest) + log.Info("WebSocket|Dailer: Creating connection to ", dest) if src == nil { src = v2net.AnyIP } @@ -33,7 +33,7 @@ func Dial(src v2net.Address, dest v2net.Destination) (internet.Connection, error var err error conn, err = wsDial(src, dest) if err != nil { - log.Warning("WS Dial failed:" + err.Error()) + log.Warning("WebSocket|Dialer: Dial failed: ", err) return nil, err } } diff --git a/transport/internet/ws/hub.go b/transport/internet/ws/hub.go index 9ac54de3..c5930211 100644 --- a/transport/internet/ws/hub.go +++ b/transport/internet/ws/hub.go @@ -45,26 +45,22 @@ func ListenWS(address v2net.Address, port v2net.Port) (internet.Listener, error) func (wsl *WSListener) listenws(address v2net.Address, port v2net.Port) error { http.HandleFunc("/"+effectiveConfig.Path, func(w http.ResponseWriter, r *http.Request) { - log.Warning("WS:WSListener->listenws->(HandleFunc,lambda 2)! Accepting websocket") con, err := wsl.converttovws(w, r) if err != nil { - log.Warning("WS:WSListener->listenws->(HandleFunc,lambda 2)!" + err.Error()) + log.Warning("WebSocket|Listener: Failed to convert connection: ", err) return } select { case wsl.awaitingConns <- &ConnectionWithError{ conn: con, - err: err, }: - log.Warning("WS:WSListener->listenws->(HandleFunc,lambda 2)! transferd websocket") default: if con != nil { con.Close() } } return - }) errchan := make(chan error) @@ -106,7 +102,7 @@ func (wsl *WSListener) listenws(address v2net.Address, port v2net.Port) error { } if err != nil { - log.Error("WS:WSListener->listenws->ListenAndServe!" + err.Error()) + log.Error("WebSocket|Listener: Failed to serve: ", err) } return err @@ -133,7 +129,6 @@ func (this *WSListener) Accept() (internet.Connection, error) { for this.acccepting { select { case connErr, open := <-this.awaitingConns: - log.Info("WSListener: conn accepted") if !open { return nil, ErrClosedListener }