support different logging level or debug mode
liuerfire opened this issue · 3 comments
Sometimes we may need see what the raw response data returned by getUpdates
is to debug 😄
Hey - I believe you should be able to do this with some botClient middlewares to intercept getUpdate API calls and log them. There are some examples in the middlewareBot sample (except that just changes some parameters rather than logging output)
Would that work for your usecase?
Yes, It does.
And I'm sorry I didn't express my meaning clearly😂. My original thought was adding more logs for easier debugging. Here the places where I think need logs:
- the
CheckUpdate
method in everyHandler
(debug level) - some debug logs at https://github.com/PaulSonOfLars/gotgbot/blob/v2.0.0-rc.29/ext/dispatcher.go#L295 for better understanding what handler is processing the message.
My apologies, I've really dropped the ball on replying here!
Thank you for your explanation - I understand better now. I can see why you're asking for these things, and I think most of it ties back to #97. It'll be much easier to provide logging levels/interfaces once i adopt the new slog packages.
Once that's done, we can extend the dispatcher to print debug information on what to iterate over. Thank you for the suggestion!