Interface LoggingScopeProvider

  • All Known Implementing Classes:
    ScopeType

    public interface LoggingScopeProvider
    Provides a scope to a log statement via the LogContext.per(LoggingScopeProvider) method.

    This interface exists to avoid needing to pass specific instances of LoggingScope around in user code. The scope provider can lookup the correct scope instance for the current thread, and different providers can provide different types of scope (e.g. you can have a provider for "request" scopes and a provider for "sub-task" scopes)

    See Also:
    Original Java code of Google Flogger
    • Method Detail

      • getCurrentScope

        @Nullable LoggingScope getCurrentScope()
        Returns the current scope (most likely via global or thread local state) or null if there is no current scope.