日志优化

This commit is contained in:
hahwu 2026-01-15 18:45:52 +08:00
parent f063cd199c
commit 48aae65afd
3 changed files with 7 additions and 6 deletions

View File

@ -62,7 +62,7 @@ func (f *FriendTreasureMod) Flip(Pos int) ([]*item.Item, int64, error) {
} }
f.Shift++ f.Shift++
Info := f.List[Pos] Info := f.List[Pos]
log.Debug("pos:%v, info:%v", Pos, Info) //log.Debug("pos:%v, info:%v", Pos, Info)
if Info.Uid != 0 { if Info.Uid != 0 {
log.Debug("uid:%v", Info.Uid) log.Debug("uid:%v", Info.Uid)
f.Uids = append(f.Uids, Info.Uid) f.Uids = append(f.Uids, Info.Uid)

View File

@ -11,7 +11,7 @@ import (
) )
const ( const (
FEISHU_WEBHOOK = "https://gadmin.bywaystudios.com/api/feishu/notify" FEISHU_WEBHOOK = "https://gadmin.bywaystudios.com/api/alibaba/game/notify"
FEISHU_ORDER = "https://gadmin.bywaystudios.com/api/feishu/notify/order" FEISHU_ORDER = "https://gadmin.bywaystudios.com/api/feishu/notify/order"
) )
@ -21,10 +21,9 @@ func SendFeishuFatal(PlayerId int, FuncName string, msg string) error {
stack := make([]byte, 1024) stack := make([]byte, 1024)
length := runtime.Stack(stack, false) length := runtime.Stack(stack, false)
payload := map[string]interface{}{ payload := map[string]interface{}{
"notify_msg": fmt.Sprintf("游戏接口出错 %s:%d", conf.Server.GameName, PlayerId), "notify_msg": fmt.Sprintf("游戏接口出错 %s:%d[炸弹][炸弹][炸弹]", conf.Server.GameName, PlayerId),
"host": FuncName, "func_name": FuncName,
"event_name": fmt.Sprintf("%s\nStack trace:\n%s", msg, stack[:length]), "stack": fmt.Sprintf("%s\nStack trace:\n%s", msg, stack[:length]),
"severity": "High",
"alarm_time": time.Unix(time.Now().Unix(), 0).Format("2006-01-02 15:04:05"), "alarm_time": time.Unix(time.Now().Unix(), 0).Format("2006-01-02 15:04:05"),
} }

View File

@ -5,11 +5,13 @@ import (
activityCfg "server/conf/activity" activityCfg "server/conf/activity"
languageCfg "server/conf/language" languageCfg "server/conf/language"
userCfg "server/conf/user" userCfg "server/conf/user"
GoUtil "server/game_util"
"server/msg" "server/msg"
"testing" "testing"
) )
func Test(t *testing.T) { func Test(t *testing.T) {
GoUtil.SendFeishuFatal(0, "Test", "error")
i := userCfg.GetEnergyMulByLv(1) i := userCfg.GetEnergyMulByLv(1)
fmt.Println(i) fmt.Println(i)
} }