refactor: update logging format in MsgInHandler to include color coding for incoming and outgoing messages, enhancing readability and context in logs

This commit is contained in:
lixiangwuxian 2025-01-15 10:47:07 +08:00
parent bad24ad2ec
commit 9272c426e3

View File

@ -92,13 +92,13 @@ func MsgInHandler(msg model.Message) (reply model.Reply) {
}
}()
if msg.RawMsg != "" {
log.Default().Printf("M:%v", msg)
log.Default().Printf("\033[31m↓\033[0m:%v", msg)
} else {
return model.Reply{}
}
defer func() {
if reply.ReplyMsg != "" {
log.Default().Printf("R:%v", reply)
log.Default().Printf("\033[32m↑\033[0m:%v", reply)
}
}()
if handlerUserID, ok := liveHandlers[msg.GroupInfo.GroupId]; ok {