google / flogger

A Fluent Logging API for Java
Apache License 2.0
1.45k stars 123 forks source link

Refactoring rate limiter code to make rate limiting more consistent when multiple rate limiters are applied to a single log statement. #338

Closed copybara-service[bot] closed 1 year ago

copybara-service[bot] commented 1 year ago

Refactoring rate limiter code to make rate limiting more consistent when multiple rate limiters are applied to a single log statement.

This rewrites the two currently support rate limiters and will cause a change in behaviour if both are used together in a single log statement, such as:

logger.atWarning().every(N).atMostEvery(T, TimeUnit).log(...);

The JavaDoc for the rate limiting methods has been updated to reflect the new behaviour.

RELNOTES=Improving rate limiter behaviour.