From 52029dac8a101a92f7ee29a044f1bc0dae5a75b2 Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 6 May 2019 11:37:16 +0800 Subject: [PATCH] debug --- td.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/td.go b/td.go index 3c143b5..0a5b2b6 100644 --- a/td.go +++ b/td.go @@ -98,7 +98,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { if err != nil { if err.Error() == "timeout" { logOnError(err, "Waiting...") - fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339)) + fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) time.Sleep(5 * time.Second) } else { logOnError(err, "Cannot get history") @@ -139,14 +139,14 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { msgCount = msgCount + 1 } default: - log.Printf("getHistory : no handler for %s\n", msg.Content.GetMessageContentEnum()) + log.Printf("getHistory(%d) : no handler for %s\n", msg.ID, msg.Content.GetMessageContentEnum()) } if m.ID64 < lastParsedID64 { lastParsedID64 = msg.ID lastParsedTime = time.Unix(int64(m.Date), 0) } if msgParsed%1000 == 0 { - fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339)) + fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) } }