grammyjs / auto-retry

A transformer function for retrying requests.
https://grammy.dev/plugins/auto-retry
MIT License
7 stars 2 forks source link

feat: Add logging to autoRetry plugin #7

Closed AbbassAlmusawi closed 8 months ago

AbbassAlmusawi commented 1 year ago

This commit adds a new option to the autoRetry transformer function that enables logging of retry attempts. If the option is set to true, the function will log the retry-after time for each failed request. The option can be passed to the function as a property of the options object.

The logging option is disabled by default, and does not affect the behavior of the function in any way when it is disabled.

AbbassAlmusawi commented 1 year ago

Thanks for the suggestion! I was prefer console.log but no problem. Appreciate the idea of using the debug method for logging.

Therefore, I will remove the "logging" option as it's no longer needed. Additionally, I will remove the if condition that checks if the logger value, since it won't be necessary anymore.

Q: I have to edit package.json to add debug dependency because it exists in grammY package.json? and I don't know how to make plug in for Deno! or I don't have to ?

Please let me know if you have any other suggestions or feedback.

AbbassAlmusawi commented 1 year ago

Done! is everything right now?

KnorpelSenf commented 1 year ago

I'll do another review tomorrow or the day after, sorry for the delay

wojpawlik commented 1 year ago

I don't know how to make plug in for Deno!

Import debug from the same place grammY does, (why does grammY miss ?dts @KnorpelSenf?), and replace typescript with deno2node.

KnorpelSenf commented 1 year ago

(why does grammY miss ?dts @KnorpelSenf?)

What do you mean?

KnorpelSenf commented 1 year ago

This is still on my radar, I just have less time than expected right now

KnorpelSenf commented 1 year ago

I have more time now, so I'll pick this up again soon

KnorpelSenf commented 8 months ago

This clearly got lost, I'm sorry.