disable yamux default log

This commit is contained in:
fatedier 2018-05-05 00:09:39 +08:00
parent b0959b3caa
commit f45283dbdb
2 changed files with 8 additions and 2 deletions

View File

@ -17,6 +17,7 @@ package client
import ( import (
"fmt" "fmt"
"io" "io"
"io/ioutil"
"runtime" "runtime"
"sync" "sync"
"time" "time"
@ -198,7 +199,9 @@ func (ctl *Control) login() (err error) {
}() }()
if g.GlbClientCfg.TcpMux { if g.GlbClientCfg.TcpMux {
session, errRet := fmux.Client(conn, nil) fmuxCfg := fmux.DefaultConfig()
fmuxCfg.LogOutput = ioutil.Discard
session, errRet := fmux.Client(conn, fmuxCfg)
if errRet != nil { if errRet != nil {
return errRet return errRet
} }

View File

@ -16,6 +16,7 @@ package server
import ( import (
"fmt" "fmt"
"io/ioutil"
"net" "net"
"net/http" "net/http"
"time" "time"
@ -234,7 +235,9 @@ func (svr *Service) HandleListener(l frpNet.Listener) {
} }
if g.GlbServerCfg.TcpMux { if g.GlbServerCfg.TcpMux {
session, err := fmux.Server(frpConn, nil) fmuxCfg := fmux.DefaultConfig()
fmuxCfg.LogOutput = ioutil.Discard
session, err := fmux.Server(frpConn, fmuxCfg)
if err != nil { if err != nil {
log.Warn("Failed to create mux connection: %v", err) log.Warn("Failed to create mux connection: %v", err)
frpConn.Close() frpConn.Close()