Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

去除不必要的info日志 #314

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions znet/connmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ func (connMgr *ConnManager) Add(conn ziface.IConnection) {

connMgr.connections.Set(conn.GetConnIdStr(), conn) // 将conn连接添加到ConnManager中

zlog.Ins().InfoF("connection add to ConnManager successfully: conn num = %d", connMgr.Len())
zlog.Ins().DebugF("connection add to ConnManager successfully: conn num = %d", connMgr.Len())
}

func (connMgr *ConnManager) Remove(conn ziface.IConnection) {

connMgr.connections.Remove(conn.GetConnIdStr()) // 删除连接信息

zlog.Ins().InfoF("connection Remove ConnID=%d successfully: conn num = %d", conn.GetConnID(), connMgr.Len())
zlog.Ins().DebugF("connection Remove ConnID=%d successfully: conn num = %d", conn.GetConnID(), connMgr.Len())
}

func (connMgr *ConnManager) Get(connID uint64) (ziface.IConnection, error) {
Expand Down
4 changes: 2 additions & 2 deletions znet/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ type HeatBeatDefaultRouter struct {
}

func (r *HeatBeatDefaultRouter) Handle(req ziface.IRequest) {
zlog.Ins().InfoF("Recv Heartbeat from %s, MsgID = %+v, Data = %s",
zlog.Ins().DebugF("Recv Heartbeat from %s, MsgID = %+v, Data = %s",
req.GetConnection().RemoteAddr(), req.GetMsgID(), string(req.GetData()))
}

func HeatBeatDefaultHandle(req ziface.IRequest) {
zlog.Ins().InfoF("Recv Heartbeat from %s, MsgID = %+v, Data = %s",
zlog.Ins().DebugF("Recv Heartbeat from %s, MsgID = %+v, Data = %s",
req.GetConnection().RemoteAddr(), req.GetMsgID(), string(req.GetData()))
}

Expand Down
14 changes: 7 additions & 7 deletions znet/kcp_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ func newKcpClientConn(client ziface.IClient, conn *kcp.UDPSession) ziface.IConne
// StartWriter is the goroutine that writes messages to the client
// (写消息Goroutine, 用户将数据发送给客户端)
func (c *KcpConnection) StartWriter() {
zlog.Ins().InfoF("Writer Goroutine is running")
defer zlog.Ins().InfoF("%s [conn Writer exit!]", c.RemoteAddr().String())
zlog.Ins().DebugF("Writer Goroutine is running")
defer zlog.Ins().DebugF("%s [conn Writer exit!]", c.RemoteAddr().String())

for {
select {
Expand All @@ -212,8 +212,8 @@ func (c *KcpConnection) StartWriter() {
// StartReader is a goroutine that reads data from the client
// (读消息Goroutine,用于从客户端中读取数据)
func (c *KcpConnection) StartReader() {
zlog.Ins().InfoF("[Reader Goroutine is running]")
defer zlog.Ins().InfoF("%s [conn Reader exit!]", c.RemoteAddr().String())
zlog.Ins().DebugF("[Reader Goroutine is running]")
defer zlog.Ins().DebugF("%s [conn Reader exit!]", c.RemoteAddr().String())
defer c.Stop()
defer func() {
if err := recover(); err != nil {
Expand Down Expand Up @@ -529,19 +529,19 @@ func (c *KcpConnection) finalizer() {
c.InvokeCloseCallbacks()
}()

zlog.Ins().InfoF("Conn Stop()...ConnID = %d", c.connID)
zlog.Ins().DebugF("Conn Stop()...ConnID = %d", c.connID)
}

func (c *KcpConnection) callOnConnStart() {
if c.onConnStart != nil {
zlog.Ins().InfoF("ZINX CallOnConnStart....")
zlog.Ins().DebugF("ZINX CallOnConnStart....")
c.onConnStart(c)
}
}

func (c *KcpConnection) callOnConnStop() {
if c.onConnStop != nil {
zlog.Ins().InfoF("ZINX CallOnConnStop....")
zlog.Ins().DebugF("ZINX CallOnConnStop....")
c.onConnStop(c)
}
}
Expand Down
2 changes: 1 addition & 1 deletion znet/msghandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ func (mh *MsgHandle) doMsgHandlerSlices(request ziface.IRequest, workerID int) {
// StartOneWorker starts a worker workflow
// (启动一个Worker工作流程)
func (mh *MsgHandle) StartOneWorker(workerID int, taskQueue chan ziface.IRequest) {
zlog.Ins().InfoF("Worker ID = %d is started.", workerID)
zlog.Ins().DebugF("Worker ID = %d is started.", workerID)
// Continuously wait for messages in the queue
// (不断地等待队列中的消息)
for {
Expand Down
Loading