```feat(log): 优化日志配置,添加异步日志标志并替换socket服务中的日志输出方式
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user