Skip to content

Commit

Permalink
Optimize the log level adjustment for tcpError and udpError by shifti…
Browse files Browse the repository at this point in the history
…ng from error to warning.
  • Loading branch information
HynoR committed Mar 23, 2024
1 parent bdd4114 commit ddb5b51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ func (l *serverLogger) TCPError(addr net.Addr, id, reqAddr string, err error) {
if err == nil {
logger.Debug("TCP closed", zap.String("addr", addr.String()), zap.String("id", id), zap.String("reqAddr", reqAddr))
} else {
logger.Error("TCP error", zap.String("addr", addr.String()), zap.String("id", id), zap.String("reqAddr", reqAddr), zap.Error(err))
logger.Warn("TCP error", zap.String("addr", addr.String()), zap.String("id", id), zap.String("reqAddr", reqAddr), zap.Error(err))
}
}

Expand All @@ -827,7 +827,7 @@ func (l *serverLogger) UDPError(addr net.Addr, id string, sessionID uint32, err
if err == nil {
logger.Debug("UDP closed", zap.String("addr", addr.String()), zap.String("id", id), zap.Uint32("sessionID", sessionID))
} else {
logger.Error("UDP error", zap.String("addr", addr.String()), zap.String("id", id), zap.Uint32("sessionID", sessionID), zap.Error(err))
logger.Warn("UDP error", zap.String("addr", addr.String()), zap.String("id", id), zap.Uint32("sessionID", sessionID), zap.Error(err))
}
}

Expand Down

0 comments on commit ddb5b51

Please sign in to comment.