Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Tags.empty() as no-op argument. Reject multiple calls to withLogLevelMap. #359

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

Use Tags.empty() as no-op argument. Reject multiple calls to withLogLevelMap.

Accepting no-op arguments allows ScopedLoggingContext to conditionally add values. A complete no-op, however, allows for syntactic misuse of the builder, calling the same method multiple times as long as all but the last provide null values.

LogLevelMap requires special care, as once a LogLevelMap is set (even if logically empty), every single log statement needs to evaluate the map.

RELNOTES=Enforce calling ScopedLoggingContext.Builder methods at most once, even with no-op params.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants