Commit af8cfdaf authored by ibuler's avatar ibuler

[Update] 去掉一些日志

parent 7d115107
package httpd
import (
"fmt"
"sync"
"github.com/jumpserver/koko/pkg/logger"
......@@ -37,14 +36,12 @@ func (c *Clients) DeleteClient(cID string) {
}
func (c *Clients) AddClient(cID string, conn *Client) {
fmt.Println("Add Client id: ", cID)
c.mu.Lock()
defer c.mu.Unlock()
c.container[cID] = conn
logger.Debug("Now clients count: ", len(c.container))
}
type Connections struct {
container map[string][]string
mu *sync.RWMutex
......@@ -69,7 +66,7 @@ func (c *Connections) GetClients(cID string) (clients []string) {
}
func (c *Connections) DeleteClients(cID string) {
if clientIDs := c.GetClients(cID); clientIDs != nil{
if clientIDs := c.GetClients(cID); clientIDs != nil {
for _, clientID := range clientIDs {
clients.DeleteClient(clientID)
}
......@@ -78,4 +75,3 @@ func (c *Connections) DeleteClients(cID string) {
defer c.mu.Unlock()
delete(c.container, cID)
}
......@@ -25,7 +25,7 @@ func OnNamespaceConnected(c *neffos.NSConn, msg neffos.Message) error {
// 首次连接 1.获取当前用户的信息
cc := c.Conn
if cc.WasReconnected() {
logger.Debugf("Web terminal redirected, with tries: %d", cc.ID(), cc.ReconnectTries)
logger.Debugf("Web terminal reconnected, with tries: %d", cc.ID(), cc.ReconnectTries)
} else {
logger.Debug("Web terminal on connect event trigger")
}
......@@ -130,7 +130,7 @@ func OnHostHandler(c *neffos.NSConn, msg neffos.Message) (err error) {
}
go func() {
defer logger.Debug("Web proxy process end")
logger.Debug("Start proxy to host")
logger.Debug("Web ssh start proxy to host")
proxySrv.Proxy()
logoutMsg, _ := json.Marshal(RoomMsg{Room: roomID})
// 服务器主动退出
......
......@@ -141,6 +141,7 @@ func (s *SwitchSession) Bridge(userConn UserConnection, srvConn srvconn.ServerCo
// 检测是否超过最大空闲时间
case <-time.After(s.MaxIdleTime * time.Minute):
msg := fmt.Sprintf(i18n.T("Connect idle more than %d minutes, disconnect"), s.MaxIdleTime)
logger.Debugf("Session idle more than %d minutes, disconnect: %s", s.MaxIdleTime, s.ID)
msg = utils.WrapperWarn(msg)
utils.IgnoreErrWriteString(userConn, "\n\r"+msg)
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment