Skip to content

Commit

Permalink
refactor: 优化log显示
Browse files Browse the repository at this point in the history
  • Loading branch information
Redmomn committed Nov 28, 2024
1 parent 7943187 commit 251a289
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions client/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func decodeOlPushServicePacket(c *QQClient, pkt *network.Packet) (any, error) {
c.FriendNotifyEvent.dispatch(c, eventConverter.ParsePokeEvent(&pb))
}
default:
c.warning("unknown subtype %d of type 0x210, proto data: %x", subType, pkg.Body.MsgContent)
c.debug("unknown subtype %d of type 0x210, proto data: %x", subType, pkg.Body.MsgContent)
}
case 0x2DC: // grp event, 732
subType := pkg.ContentHead.SubType.Unwrap()
Expand Down Expand Up @@ -337,10 +337,10 @@ func decodeOlPushServicePacket(c *QQClient, pkt *network.Packet) (any, error) {
c.GroupMuteEvent.dispatch(c, ev)
return nil, nil
default:
c.warning("Unsupported group event, subType: %v, proto data: %x", subType, pkg.Body.MsgContent)
c.debug("Unsupported group event, subType: %v, proto data: %x", subType, pkg.Body.MsgContent)
}
default:
c.warning("Unsupported message type: %v, proto data: %x", typ, pkg.Body.MsgContent)
c.debug("Unsupported message type: %v, proto data: %x", typ, pkg.Body.MsgContent)
}

return nil, nil
Expand Down
4 changes: 2 additions & 2 deletions client/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ func (c *QQClient) SetLogger(logger log.Logger) {

func (c *QQClient) info(msg string, args ...any) {
if c.logger != nil {
c.logger.Info(log.Getcaller(msg), args...)
c.logger.Info(msg, args...)
}
}

func (c *QQClient) infoln(msgs ...any) {
if c.logger != nil {
c.logger.Info(log.Getcaller(fmt.Sprint(msgs...)))
c.logger.Info(fmt.Sprint(msgs...))
}
}

Expand Down

0 comments on commit 251a289

Please sign in to comment.