mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-03 09:28:55 +00:00
add tracing and refactor some api pkgs
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package tracing
|
||||
|
||||
import (
|
||||
"runtime"
|
||||
|
||||
"github.com/caos/logging"
|
||||
)
|
||||
|
||||
func GetCaller() string {
|
||||
fpcs := make([]uintptr, 1)
|
||||
|
||||
n := runtime.Callers(3, fpcs)
|
||||
if n == 0 {
|
||||
logging.Log("HELPE-rWjfC").Debug("no caller")
|
||||
}
|
||||
|
||||
caller := runtime.FuncForPC(fpcs[0] - 1)
|
||||
if caller == nil {
|
||||
logging.Log("HELPE-25POw").Debug("caller was nil")
|
||||
}
|
||||
|
||||
// Print the name of the function
|
||||
return caller.Name()
|
||||
}
|
||||
Reference in New Issue
Block a user