增加调用堆栈的获取
This commit is contained in:
21
trace.go
Normal file
21
trace.go
Normal file
@ -0,0 +1,21 @@
|
||||
// Package trace ...
|
||||
//
|
||||
// Description : trace ...
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 2022-10-15 00:37
|
||||
package trace
|
||||
|
||||
import "runtime"
|
||||
|
||||
// GetTraceFileInfo 获取文件 trace 信息
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 00:44 2022/10/15
|
||||
func GetTraceFileInfo(offset int) CallStack {
|
||||
stack := CallStack{}
|
||||
_, stack.FilePath, stack.LineNo, _ = runtime.Caller(offset)
|
||||
return stack
|
||||
}
|
Reference in New Issue
Block a user