新增日志模块

This commit is contained in:
boyce
2019-02-12 17:19:22 +08:00
parent 188ee36057
commit 4a9ab2e899
5 changed files with 142 additions and 7 deletions

View File

@@ -2,6 +2,9 @@ package originnode
import (
_ "net/http/pprof"
"sync"
"github.com/duanhf2012/origin/sysmodule"
"github.com/duanhf2012/origin/service"
)
@@ -23,3 +26,20 @@ func AddModule(module service.IModule) bool {
func GetModuleByType(moduleType uint32) service.IModule {
return g_module.GetModuleByType(moduleType)
}
func GetLog(logmodule uint32) sysmodule.ILogger {
module := g_module.GetModuleByType(logmodule)
if nil == module {
return nil
}
return module.(sysmodule.ILogger)
}
func InitGlobalModule() {
g_module.InitModule(&g_module)
}
func RunGlobalModule(exit chan bool, pwaitGroup *sync.WaitGroup) {
g_module.RunModule(&g_module, exit, pwaitGroup)
}