Class AbstractStyleNameConverter

    • Field Detail

      • style

        private final java.lang.String style
    • Constructor Detail

      • AbstractStyleNameConverter

        protected AbstractStyleNameConverter​(java.lang.String name,
                                             java.util.List<PatternFormatter> formatters,
                                             java.lang.String styling)
        Constructs the converter.
        Parameters:
        formatters - The PatternFormatters to generate the text to manipulate.
        styling - The styling that should encapsulate the pattern.
    • Method Detail

      • newInstance

        protected static <T extends AbstractStyleNameConverter> T newInstance​(java.lang.Class<T> asnConverterClass,
                                                                              java.lang.String name,
                                                                              Configuration config,
                                                                              java.lang.String[] options)
        Gets an instance of the class (called via reflection).
        Parameters:
        config - The current Configuration.
        options - The pattern options, may be null. If the first element is "short", only the first line of the throwable will be formatted.
        Returns:
        new instance of class or null
      • toPatternFormatterList

        private static java.util.List<PatternFormatter> toPatternFormatterList​(Configuration config,
                                                                               java.lang.String[] options)
        Creates a list of PatternFormatter from the given configuration and options or null if no pattern is supplied.
        Parameters:
        config - A configuration.
        options - pattern options.
        Returns:
        a list of PatternFormatter from the given configuration and options or null if no pattern is supplied.
      • format

        public void format​(LogEvent event,
                           java.lang.StringBuilder toAppendTo)
        Formats an event into a string buffer.
        Specified by:
        format in class LogEventPatternConverter
        Parameters:
        event - event to format, may not be null.
        toAppendTo - string buffer to which the formatted event will be appended. May not be null.
      • handlesThrowable

        public boolean handlesThrowable()
        Description copied from class: LogEventPatternConverter
        Tests whether this pattern converter is renders a Throwable.

        The PatternParser checks this flag when processing the alwaysWriteExceptions option: if no converter in the pattern handles throwables, the parser automatically appends a converter to ensure exceptions are still written.

        Overrides:
        handlesThrowable in class LogEventPatternConverter
        Returns:
        true if this converter consumes and renders a Throwable, false otherwise