fix(be):使用next-terminal 自定义的日志

This commit is contained in:
neverteaser
2021-03-19 22:58:47 +08:00
committed by dushixiang
parent 518e665d17
commit 9d38e5fef7
19 changed files with 322 additions and 184 deletions

View File

@ -6,7 +6,8 @@ import (
"os"
"time"
"github.com/sirupsen/logrus"
"next-terminal/pkg/log"
"golang.org/x/crypto/ssh"
"golang.org/x/crypto/ssh/terminal"
)
@ -30,7 +31,7 @@ func main() {
client, err := ssh.Dial("tcp", "172.16.101.32:22", sshConfig)
if err != nil {
logrus.Error(err)
log.Error(err)
}
defer client.Close()
@ -87,9 +88,9 @@ func (t *SSHTerminal) interactiveSession() error {
defer func() {
if t.exitMsg == "" {
logrus.Info(os.Stdout, "the connection was closed on the remote side on ", time.Now().Format(time.RFC822))
log.Info(os.Stdout, "the connection was closed on the remote side on ", time.Now().Format(time.RFC822))
} else {
logrus.Info(os.Stdout, t.exitMsg)
log.Info(os.Stdout, t.exitMsg)
}
}()