```
refactor(cool): 修复Logger变量名拼写错误 将全局Logger变量从Loger修正为Logger,统一日志实例命名规范, 确保所有模块中日志记录的一致性。 BREAKING CHANGE: 全局日志实例变量名从Loger改为Logger ```
This commit is contained in:
@@ -44,7 +44,7 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
|
||||
if err := recover(); err != nil { // 恢复 panic,err 为 panic 错误值
|
||||
// 1. 打印错误信息
|
||||
|
||||
cool.Loger.Error(context.TODO(), "panic 错误:", err)
|
||||
cool.Logger.Error(context.TODO(), "panic 错误:", err)
|
||||
|
||||
}
|
||||
}()
|
||||
@@ -111,7 +111,7 @@ func (s *Server) OnTraffic(c gnet.Conn) (action gnet.Action) {
|
||||
if err := recover(); err != nil { // 恢复 panic,err 为 panic 错误值
|
||||
// 1. 打印错误信息
|
||||
|
||||
cool.Loger.Error(context.TODO(), "panic 错误:", err)
|
||||
cool.Logger.Error(context.TODO(), "panic 错误:", err)
|
||||
|
||||
}
|
||||
}()
|
||||
@@ -187,7 +187,7 @@ func (s *Server) handleTcp(conn gnet.Conn) (action gnet.Action) {
|
||||
|
||||
if conn.InboundBuffered() > 0 {
|
||||
if err := conn.Wake(nil); err != nil { // wake up the connection manually to avoid missing the leftover data
|
||||
cool.Loger.Errorf(context.Background(), "failed to wake up the connection, %v", err)
|
||||
cool.Logger.Errorf(context.Background(), "failed to wake up the connection, %v", err)
|
||||
return gnet.Close
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ type Broadcast struct {
|
||||
}
|
||||
|
||||
func (h *Server) Broadcast(t string) int {
|
||||
cool.Loger.Info(context.TODO(), "全服广播", t)
|
||||
cool.Logger.Info(context.TODO(), "全服广播", t)
|
||||
var count int
|
||||
player.Mainplayer.Range(func(key uint32, value *player.Player) bool {
|
||||
count++
|
||||
@@ -25,7 +25,7 @@ func (h *Server) Broadcast(t string) int {
|
||||
return count
|
||||
}
|
||||
func (h *Server) KickPerson(a int) error {
|
||||
cool.Loger.Info(context.TODO(), "检测到踢人请求", a)
|
||||
cool.Logger.Info(context.TODO(), "检测到踢人请求", a)
|
||||
if a == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user