Interface ComponentLoggerProvider.LoggerHelper

  • Enclosing interface:
    ComponentLoggerProvider

    @NonExtendable
    public static interface ComponentLoggerProvider.LoggerHelper
    A factory for default implementations of component loggers.
    Since:
    4.11.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NotNull ComponentLogger delegating​(@NotNull org.slf4j.Logger base, @NotNull java.util.function.Function<Component,​java.lang.String> serializer)
      Create a component logger based on one which delegates to an underlying plain Logger implementation.
      @NotNull java.util.function.Function<Component,​java.lang.String> plainSerializer()
      Create a serializer function that will translate logged output into the system default locale, and then serialize it to plain text.
    • Method Detail

      • plainSerializer

        @NotNull
        @NotNull java.util.function.Function<Component,​java.lang.String> plainSerializer()
        Create a serializer function that will translate logged output into the system default locale, and then serialize it to plain text.
        Returns:
        a plain serializer
        Since:
        4.11.0
      • delegating

        @NotNull
        @NotNull ComponentLogger delegating​(@NotNull
                                            @NotNull org.slf4j.Logger base,
                                            @NotNull
                                            @NotNull java.util.function.Function<Component,​java.lang.String> serializer)
        Create a component logger based on one which delegates to an underlying plain Logger implementation.

        This sort of logger requires Components to be serialized to some sort of formatted String to match the SLF4J contract.

        Parameters:
        base - the base logger
        serializer - the serializer to translate and format a component in a log message.
        Returns:
        a new logger
        Since:
        4.11.0