public static class GoogleLoggingApi.NoOp<API extends GoogleLoggingApi<API>> extends com.google.common.flogger.LoggingApi.NoOp<API> implements GoogleLoggingApi<API>
GoogleLoggingApi which does nothing and discards all parameters.GoogleLoggingApi.NoOp<API extends GoogleLoggingApi<API>>| Constructor and Description |
|---|
NoOp() |
| Modifier and Type | Method and Description |
|---|---|
<T> API |
with(com.google.common.flogger.MetadataKey<T> key,
T value)
Associates a metadata key constant with a runtime value for this log statement in a structured
way that is accessible to logger backends.
|
atMostEvery, every, isEnabled, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logVarargs, noOp, withCause, withInjectedLogSite, withInjectedLogSite, withStackTraceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitatMostEvery, every, isEnabled, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logVarargs, withCause, withInjectedLogSite, withInjectedLogSite, withStackTracepublic final <T> API with(com.google.common.flogger.MetadataKey<T> key, @Nullable T value)
GoogleLoggingApiThis method is not a replacement for general parameter passing in the LoggingApi.log() method
and should be reserved for keys/values with specific semantics. Examples include:
Metadata keys can support repeated values (see MetadataKey.canRepeat()), and if a
repeatable key is used multiple times in the same log statement, the effect is to collect all
the given values in order. If a non-repeatable key is passed multiple times, only the last
value is retained (though callers should not rely on this behavior and should simply avoid
repeating non-repeatable keys).
If value is null, this method is a no-op. This is useful for specifying
conditional values (e.g. via logger.atInfo().with(MY_KEY, getValueOrNull()).log(...)).
with in interface GoogleLoggingApi<API extends GoogleLoggingApi<API>>key - the metadata key (expected to be a static constant)value - a value to be associated with the key in this log statement. Null values are
allowed, but the effect is always a no-opMetadataKey