How to stop the rate limit logging #405
-
So i am trying to write a application which sends webhook to a channel to report about some stats and it sometimes has to do it fast so the rate limiter tries to rate limit it but it then prints a warn message with the webhook in logs which i dont want cuz sometimes i need to share logs publically and i like the webhook warning that prints the webhook is anoying here is my basic code webhook_logger := logrus.New()
webhook_logger.SetLevel(logrus.FatalLevel)
client, err := webhook.NewWithURL(catbox.G_config.WebhookURL, webhook.WithLogger(webhook_logger))
if err != nil {
app.G_logger.Errorln(err)
os.Exit(1)
} so how do i stop it from printing the warn message with my webhook url |
Beta Was this translation helpful? Give feedback.
Answered by
topi314
Dec 12, 2024
Replies: 1 comment
-
you can pass a logger with the level set to webhook.NewWithURL(url,
webhook.WithRestClientConfigOpts(
rest.WithRateLimiterConfigOpts(
rest.WithRateLimiterLogger(logger),
),
),
) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
BlindAndInsane
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can pass a logger with the level set to
ERROR
to the ratelimiter used by the webhook