logging improvements

This commit is contained in:
Watn3y 2023-03-05 05:45:36 +01:00
parent c63dbc666d
commit 6a31972ad0
8 changed files with 35 additions and 15 deletions

View file

@ -1,5 +1,11 @@
package commonlogic
import (
"reflect"
"runtime"
"strings"
)
func ContainsInt64(a []int64, b int64) bool {
for _, v := range a {
if v == b {
@ -9,3 +15,9 @@ func ContainsInt64(a []int64, b int64) bool {
return false
}
func GetPackageName(temp interface{}) string {
strs := strings.Split((runtime.FuncForPC(reflect.ValueOf(temp).Pointer()).Name()), ".")
strs = strings.Split(strs[len(strs)-2], "/")
return strs[len(strs)-1]
}