change level for log message

tls
fangdingjun 6 years ago
parent e821ce6ecb
commit 3a5b7b1bd6

@ -2,10 +2,11 @@ package main
import ( import (
"bytes" "bytes"
"io/ioutil"
"github.com/fangdingjun/go-log"
"github.com/go-yaml/yaml" "github.com/go-yaml/yaml"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"
"io/ioutil"
"log"
) )
type listen struct { type listen struct {
@ -51,7 +52,7 @@ func loadConfig(f string) (*serverConfig, error) {
for i := range c.Users { for i := range c.Users {
buf1, err := ioutil.ReadFile(c.Users[i].AuthorizedKeyFile) buf1, err := ioutil.ReadFile(c.Users[i].AuthorizedKeyFile)
if err != nil { if err != nil {
log.Printf("read publickey for %s failed, ignore", c.Users[i].Username) log.Warnf("read publickey for %s failed, ignore", c.Users[i].Username)
continue continue
} }

@ -298,7 +298,7 @@ func (sc *Server) handleTcpipForward(req *ssh.Request) {
for { for {
c, err := l.Accept() c, err := l.Accept()
if err != nil { if err != nil {
log.Errorf("%s", err.Error()) log.Debugf("%s", err.Error())
return return
} }
log.Debugf("accept connection from %s", c.RemoteAddr()) log.Debugf("accept connection from %s", c.RemoteAddr())

Loading…
Cancel
Save