Fix some logs
This commit is contained in:
parent
0c7e11d8f0
commit
56bfc105ed
2 changed files with 9 additions and 4 deletions
|
@ -185,10 +185,13 @@ func (c *Client) HandleRPCMsg(rawMsg *gmproto.IncomingRPCMessage) {
|
||||||
if c.sessionHandler.receiveResponse(msg) {
|
if c.sessionHandler.receiveResponse(msg) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.Logger.Debug().
|
logEvt := c.Logger.Debug().
|
||||||
Stringer("message_action", msg.Message.Action).
|
|
||||||
Str("message_id", msg.ResponseID).
|
Str("message_id", msg.ResponseID).
|
||||||
Msg("Received message")
|
Stringer("bugle_route", msg.BugleRoute)
|
||||||
|
if msg.Message != nil {
|
||||||
|
logEvt.Stringer("message_action", msg.Message.Action)
|
||||||
|
}
|
||||||
|
logEvt.Msg("Received message")
|
||||||
switch msg.BugleRoute {
|
switch msg.BugleRoute {
|
||||||
case gmproto.BugleRoute_PairEvent:
|
case gmproto.BugleRoute_PairEvent:
|
||||||
c.handlePairingEvent(msg)
|
c.handlePairingEvent(msg)
|
||||||
|
|
|
@ -130,9 +130,11 @@ func (s *SessionHandler) receiveResponse(msg *IncomingRPCMessage) bool {
|
||||||
delete(s.responseWaiters, requestID)
|
delete(s.responseWaiters, requestID)
|
||||||
s.responseWaitersLock.Unlock()
|
s.responseWaitersLock.Unlock()
|
||||||
evt := s.client.Logger.Debug().
|
evt := s.client.Logger.Debug().
|
||||||
Stringer("message_action", msg.Message.Action).
|
|
||||||
Str("request_message_id", requestID).
|
Str("request_message_id", requestID).
|
||||||
Str("response_message_id", msg.ResponseID)
|
Str("response_message_id", msg.ResponseID)
|
||||||
|
if msg.Message != nil {
|
||||||
|
evt.Stringer("message_action", msg.Message.Action)
|
||||||
|
}
|
||||||
if s.client.Logger.GetLevel() == zerolog.TraceLevel {
|
if s.client.Logger.GetLevel() == zerolog.TraceLevel {
|
||||||
if msg.DecryptedData != nil {
|
if msg.DecryptedData != nil {
|
||||||
evt.Str("data", base64.StdEncoding.EncodeToString(msg.DecryptedData))
|
evt.Str("data", base64.StdEncoding.EncodeToString(msg.DecryptedData))
|
||||||
|
|
Loading…
Reference in a new issue