From de969996ace9ecc0fbf10a3265889426a19de328 Mon Sep 17 00:00:00 2001 From: Julio Tain Sueiras Date: Tue, 25 Feb 2020 20:22:47 -0500 Subject: [PATCH] Added loggig for tcp portion --- langserver/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/langserver/main.go b/langserver/main.go index daca2e2..caf39af 100644 --- a/langserver/main.go +++ b/langserver/main.go @@ -8,6 +8,7 @@ import ( "github.com/creachadair/jrpc2/handler" "github.com/creachadair/jrpc2/server" log "github.com/sirupsen/logrus" + oldLog "log" "net" "os" ) @@ -75,11 +76,14 @@ func RunTCPServer(port int) { ctx, cancelFunc := context.WithCancel(ctx) + oldLogInstance := oldLog.New(os.Stdout, "", 0) + go func() { if err := server.Loop(lst, ServiceMap, &server.LoopOptions{ Framing: newChan, ServerOptions: &jrpc2.ServerOptions{ AllowPush: true, + Logger: oldLogInstance, }, }); err != nil { log.Errorf("Loop: unexpected failure: %v", err)