google / google/flogger

Use java.time.Duration for atMostEvery in LoggingApi.

Open
#325 2 comments 0 reactions 0 assignees View on GitHub
P3 type=addition
Dominant language
Java
Stars
1.5k
Forks
133
Avg merge
6m
Merged PRs (30d)
7

Description

Presently, `atMostEvery` only supports `int` and `java.util.concurrent.TimeUnit`. However, the parameters become inconvenient to use for `java.time.Duration`. Additionally, when using `java.time.Duration#toNanos` and `TimeUnit#NANOSECONDS, the field gets truncated to an `int`. This causes the implementer of the duration field to explicitly field depth to avoid overflow, which can become awkward.

I would like `atMostEvery` to support `java.time.Duration`, rather than it's present args. This would make more sense on an usability standpoint of this API.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.