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:
parent
bad24ad2ec
commit
9272c426e3
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user