mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-14 20:08:02 +00:00
fa9f581d56
* chore: move to new org * logging * fix: org rename caos -> zitadel Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
23 lines
386 B
Go
23 lines
386 B
Go
package tracing
|
|
|
|
import (
|
|
"runtime"
|
|
|
|
"github.com/zitadel/logging"
|
|
)
|
|
|
|
func GetCaller() string {
|
|
fpcs := make([]uintptr, 1)
|
|
n := runtime.Callers(3, fpcs)
|
|
if n == 0 {
|
|
logging.Log("TRACE-rWjfC").Debug("no caller")
|
|
return ""
|
|
}
|
|
caller := runtime.FuncForPC(fpcs[0] - 1)
|
|
if caller == nil {
|
|
logging.Log("TRACE-25POw").Debug("caller was nil")
|
|
return ""
|
|
}
|
|
return caller.Name()
|
|
}
|