mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增错误日志
This commit is contained in:
@@ -109,9 +109,12 @@ func (slf *BaseModule) GetModuleCount() int {
|
||||
}
|
||||
|
||||
func (slf *BaseModule) genModuleId() uint32 {
|
||||
slf.CurrMaxModuleId++
|
||||
slf.CurrMaxModuleId = slf.CurrMaxModuleId + 1
|
||||
moduleId := slf.CurrMaxModuleId
|
||||
|
||||
if moduleId == 0 {
|
||||
GetLogger().Printf(LEVER_ERROR, "%T Cannot AddModule %T is zero", slf.GetSelf(), module.GetSelf())
|
||||
}
|
||||
return moduleId
|
||||
}
|
||||
|
||||
@@ -211,8 +214,10 @@ func (slf *BaseModule) AddModule(module IModule) uint32 {
|
||||
defer locker.Unlock()
|
||||
|
||||
//如果没有设置,自动生成ModuleId
|
||||
var genid uint32
|
||||
if module.GetModuleId() == 0 {
|
||||
module.SetModuleId(slf.genModuleId())
|
||||
genid = slf.genModuleId()
|
||||
module.SetModuleId(genid)
|
||||
}
|
||||
|
||||
module.getBaseModule().selfModule = module
|
||||
@@ -234,6 +239,7 @@ func (slf *BaseModule) AddModule(module IModule) uint32 {
|
||||
}
|
||||
_, ok := slf.mapModule[module.GetModuleId()]
|
||||
if ok == true {
|
||||
GetLogger().Printf(LEVER_ERROR, "check mapModule %#v id is %d ,%d is fail...", module, module.GetModuleId(),genid)
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user