ScopeType

public final class ScopeType implements LoggingScopeProvider

Singleton keys which identify different types of scopes which scoped contexts can be bound to.

To bind a context to a scope type, create the context with that type:


ScopedLoggingContext.getInstance().newScope(REQUEST).run(() -> someTask(...));

See also

<a href="https://github.com/google/flogger/blob/cb9e836a897d36a78309ee8badf5cad4e6a2d3d8/api/src/main/java/com/google/common/flogger/context/ScopeType.java">

Original Java code of Google Flogger

Properties

Link copied to clipboard
public final static ScopeType REQUEST
The built in "request" scope.

Functions

Link copied to clipboard
public static ScopeType create(String name)
Creates a new Scope type, which can be used as a singleton key to identify a scope during scoped context creation or logging.
Link copied to clipboard
@Nullable()
public @Nullable() LoggingScope getCurrentScope()
Returns the current scope (most likely via global or thread local state) or null if there is no current scope.