对日志监听器新增文件名和行数

This commit is contained in:
boyce
2019-03-26 14:39:26 +08:00
parent e0ae07388f
commit b0156ce788
4 changed files with 29 additions and 3 deletions

View File

@@ -295,7 +295,7 @@ func (slf *BaseModule) RunModule(module IModule) {
slf.recoverCount += 1
//重试3次
if slf.recoverCount < 4 {
if slf.recoverCount < 10 {
go slf.RunModule(slf.GetSelf())
} else {
GetLogger().Printf(LEVER_FATAL, "Routine %T.OnRun has exited!", module)
@@ -333,6 +333,7 @@ func (slf *BaseModule) RunModule(module IModule) {
GetLogger().Printf(LEVER_INFO, "OnEndRun module %T...", module)
return
}
}
}

View File

@@ -60,7 +60,6 @@ func (slf *CServiceManager) Init(logger ILogger, exit chan bool, pwaitGroup *syn
func (slf *CServiceManager) Start() bool {
for _, sname := range slf.orderLocalService {
s := slf.FindService(sname)
GetLogger().Printf(LEVER_INFO, "Start Init module %T.", s.(IModule))
err := s.(IModule).OnInit()
if err != nil {
@@ -103,3 +102,13 @@ func InstanceServiceMgr() *CServiceManager {
func GetLogger() ILogger {
return InstanceServiceMgr().GetLogger()
}
func (slf *CServiceManager) IsFinishInit() bool {
for _, val := range slf.localserviceMap {
if val.IsInit() == false {
return false
}
}
return true
}