This commit is contained in:
boyce
2019-03-29 11:26:19 +08:00
2 changed files with 9 additions and 1 deletions

View File

@@ -98,6 +98,14 @@ func (slf *BaseModule) GetModuleById(moduleId uint32) IModule {
return ret
}
func (slf *BaseModule) GetModuleCount() int {
locker := slf.GetRoot().getBaseModule().getLocker()
locker.Lock()
defer locker.Unlock()
return len(slf.mapModule)
}
func (slf *BaseModule) genModuleId() uint32 {
slf.CurrMaxModuleId++
moduleId := slf.CurrMaxModuleId

View File

@@ -106,7 +106,7 @@ func (slf *LogModule) Printf(level uint, format string, v ...interface{}) {
if slf.openLevel == LEVER_DEBUG || slf.listenFun != nil {
strlog := fmt.Sprintf(format, v...)
if slf.openLevel == LEVER_DEBUG {
fmt.Println(LogPrefix[level], strlog)
fmt.Println(LogPrefix[level], time.Now().Format("2006/1/2 15:04:05"), strlog)
}
if slf.listenFun != nil {