Improve debug logging of Telegram updates

calls
bodqhrohro 4 years ago
parent 354a4acd19
commit 5b82d5d718

@ -48,30 +48,35 @@ func (c *Client) updateHandler() {
uhOh() uhOh()
} }
c.updateUser(typedUpdate) c.updateUser(typedUpdate)
log.Debugf("%#v", typedUpdate.User)
case client.TypeUpdateUserStatus: case client.TypeUpdateUserStatus:
typedUpdate, ok := update.(*client.UpdateUserStatus) typedUpdate, ok := update.(*client.UpdateUserStatus)
if !ok { if !ok {
uhOh() uhOh()
} }
c.updateUserStatus(typedUpdate) c.updateUserStatus(typedUpdate)
log.Debugf("%#v", typedUpdate.Status)
case client.TypeUpdateNewChat: case client.TypeUpdateNewChat:
typedUpdate, ok := update.(*client.UpdateNewChat) typedUpdate, ok := update.(*client.UpdateNewChat)
if !ok { if !ok {
uhOh() uhOh()
} }
c.updateNewChat(typedUpdate) c.updateNewChat(typedUpdate)
log.Debugf("%#v", typedUpdate.Chat)
case client.TypeUpdateNewMessage: case client.TypeUpdateNewMessage:
typedUpdate, ok := update.(*client.UpdateNewMessage) typedUpdate, ok := update.(*client.UpdateNewMessage)
if !ok { if !ok {
uhOh() uhOh()
} }
c.updateNewMessage(typedUpdate) c.updateNewMessage(typedUpdate)
log.Debugf("%#v", typedUpdate.Message)
case client.TypeUpdateMessageContent: case client.TypeUpdateMessageContent:
typedUpdate, ok := update.(*client.UpdateMessageContent) typedUpdate, ok := update.(*client.UpdateMessageContent)
if !ok { if !ok {
uhOh() uhOh()
} }
c.updateMessageContent(typedUpdate) c.updateMessageContent(typedUpdate)
log.Debugf("%#v", typedUpdate.NewContent)
case client.TypeUpdateDeleteMessages: case client.TypeUpdateDeleteMessages:
typedUpdate, ok := update.(*client.UpdateDeleteMessages) typedUpdate, ok := update.(*client.UpdateDeleteMessages)
if !ok { if !ok {
@ -84,6 +89,7 @@ func (c *Client) updateHandler() {
uhOh() uhOh()
} }
c.updateFile(typedUpdate) c.updateFile(typedUpdate)
log.Debugf("%#v", typedUpdate.File)
default: default:
// log only handled types // log only handled types
continue continue

Loading…
Cancel
Save