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:
goc_natalia committed 2024-05-16 13:45:13 +02:00
1 parent 6fb12e9e9d
commit ab5b70704d
8 files changed
+389 -66

No files matched your search

+13
View 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()
}