standardize commonly used attributes
Some commonly used at maal attributes have been encoded as consts with convinience wrappers similar to those of semconv package from otel sdk. Additionally some utils that can generate mutliple attributes were added.
This commit is contained in:
13
pkg/code_location/code_location.go
Normal file
13
pkg/code_location/code_location.go
Normal file
@ -0,0 +1,13 @@
|
||||
package code_location
|
||||
|
||||
type CodeLocation struct {
|
||||
FilePath string
|
||||
FuncName string
|
||||
LineNumber int
|
||||
ColumnNumber int
|
||||
}
|
||||
|
||||
func FromStackTrace(...atDepth int) {
|
||||
pc, file, line, _ := runtime.Caller(1 + skipLevelsInCallStack)
|
||||
funcName := runtime.FuncForPC(pc).Name()
|
||||
}
|
Reference in New Issue
Block a user