mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
fixed log call depth.
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
package originnode
|
||||
|
||||
import (
|
||||
_ "net/http/pprof"
|
||||
)
|
||||
|
||||
/*
|
||||
type GlobalModule struct {
|
||||
service.BaseModule
|
||||
}
|
||||
|
||||
// 全局模块定义
|
||||
var g_module GlobalModule
|
||||
|
||||
func AddModule(module service.IModule) uint32 {
|
||||
return g_module.AddModule(module)
|
||||
}
|
||||
|
||||
func GetModuleById(moduleId uint32) service.IModule {
|
||||
return g_module.GetModuleById(moduleId)
|
||||
}
|
||||
|
||||
func GetLog(logmodule uint32) sysmodule.ILogger {
|
||||
module := g_module.GetModuleById(logmodule)
|
||||
if nil == module {
|
||||
return nil
|
||||
}
|
||||
|
||||
return module.(sysmodule.ILogger)
|
||||
}
|
||||
|
||||
func InitGlobalModule(exit chan bool, pwaitGroup *sync.WaitGroup) {
|
||||
g_module.InitModule(exit, pwaitGroup)
|
||||
}
|
||||
|
||||
func RunGlobalModule() {
|
||||
go g_module.RunModule(&g_module)
|
||||
}
|
||||
*/
|
||||
@@ -113,7 +113,7 @@ func (slf *LogModule) Printf(level uint, format string, v ...interface{}) {
|
||||
var file string
|
||||
var line int
|
||||
var ok bool
|
||||
_, file, line, ok = runtime.Caller(3)
|
||||
_, file, line, ok = runtime.Caller(slf.calldepth - 1)
|
||||
if !ok {
|
||||
file = "???"
|
||||
line = 0
|
||||
|
||||
Reference in New Issue
Block a user