Skip to content

Commit

Permalink
Added loggig for tcp portion
Browse files Browse the repository at this point in the history
  • Loading branch information
juliosueiras committed Feb 26, 2020
1 parent 28ac09f commit de96999
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions langserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/creachadair/jrpc2/handler"
"github.com/creachadair/jrpc2/server"
log "github.com/sirupsen/logrus"
oldLog "log"
"net"
"os"
)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit de96999

Please sign in to comment.