mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 11:17:32 +00:00
chore: move the go code into a subfolder
This commit is contained in:
22
apps/api/internal/telemetry/tracing/caller.go
Normal file
22
apps/api/internal/telemetry/tracing/caller.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package tracing
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
)
|
||||
|
||||
func GetCaller() string {
|
||||
fpcs := make([]uintptr, 1)
|
||||
n := runtime.Callers(3, fpcs)
|
||||
if n == 0 {
|
||||
logging.WithFields("logID", "TRACE-rWjfC").Debug("no caller")
|
||||
return ""
|
||||
}
|
||||
caller := runtime.FuncForPC(fpcs[0] - 1)
|
||||
if caller == nil {
|
||||
logging.WithFields("logID", "TRACE-25POw").Debug("caller was nil")
|
||||
return ""
|
||||
}
|
||||
return caller.Name()
|
||||
}
|
Reference in New Issue
Block a user