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.
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.