```feat(log): 优化日志配置,添加异步日志标志并替换socket服务中的日志输出方式

This commit is contained in:
1
2025-12-11 20:27:10 +00:00
parent 32c61f37bd
commit 5ecfd0396c
2 changed files with 4 additions and 2 deletions

View File

@@ -11,6 +11,8 @@ import (
"blazing/cool"
"blazing/logic/service/player"
"github.com/gogf/gf/v2/os/glog"
"github.com/gogf/gf/v2/os/gtime"
"github.com/panjf2000/gnet/v2"
)
@@ -75,7 +77,7 @@ func (s *Server) OnClose(c gnet.Conn, err error) (action gnet.Action) {
return
}
func (s *Server) OnTick() (delay time.Duration, action gnet.Action) {
cool.Loger.Infof(context.Background(), "[connected-count=%v]", atomic.LoadInt64(&s.connected))
glog.Infof(context.Background(), gtime.Now().ISO8601(), "[connected-count=%v]", atomic.LoadInt64(&s.connected))
if s.quit && atomic.LoadInt64(&s.connected) == 0 {
//执行正常退出逻辑
os.Exit(0)