mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Reduce logging in dqlite
This commit is contained in:
parent
0ae20eb7a3
commit
b2439788d7
@ -1,6 +1,8 @@
|
||||
package dqlite
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/canonical/go-dqlite/client"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -13,7 +15,11 @@ func log() client.LogFunc {
|
||||
case client.LogError:
|
||||
logrus.Errorf(s, i...)
|
||||
case client.LogInfo:
|
||||
if strings.HasPrefix(s, "connected") {
|
||||
logrus.Debugf(s, i...)
|
||||
} else {
|
||||
logrus.Infof(s, i...)
|
||||
}
|
||||
case client.LogWarn:
|
||||
logrus.Warnf(s, i...)
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ func Connect(src net.Conn, dst net.Conn) {
|
||||
go func() {
|
||||
_, err := io.Copy(eagain.Writer{Writer: dst}, eagain.Reader{Reader: src})
|
||||
if err != nil && err != io.EOF {
|
||||
logrus.Warnf("copy pipe src->dst closed: %v", err)
|
||||
logrus.Debugf("copy pipe src->dst closed: %v", err)
|
||||
}
|
||||
src.Close()
|
||||
dst.Close()
|
||||
@ -38,7 +38,7 @@ func Connect(src net.Conn, dst net.Conn) {
|
||||
go func() {
|
||||
_, err := io.Copy(eagain.Writer{Writer: src}, eagain.Reader{Reader: dst})
|
||||
if err != nil {
|
||||
logrus.Warnf("copy pipe dst->src closed: %v", err)
|
||||
logrus.Debugf("copy pipe dst->src closed: %v", err)
|
||||
}
|
||||
src.Close()
|
||||
dst.Close()
|
||||
|
Loading…
Reference in New Issue
Block a user