Class AbstractStyleNameConverter
- java.lang.Object
-
- org.apache.logging.log4j.core.pattern.AbstractPatternConverter
-
- org.apache.logging.log4j.core.pattern.LogEventPatternConverter
-
- org.apache.logging.log4j.core.pattern.AbstractStyleNameConverter
-
- All Implemented Interfaces:
PatternConverter
- Direct Known Subclasses:
AbstractStyleNameConverter.Black
,AbstractStyleNameConverter.Blue
,AbstractStyleNameConverter.Cyan
,AbstractStyleNameConverter.Green
,AbstractStyleNameConverter.Magenta
,AbstractStyleNameConverter.Red
,AbstractStyleNameConverter.White
,AbstractStyleNameConverter.Yellow
public abstract class AbstractStyleNameConverter extends LogEventPatternConverter
Style pattern converter. Adds ANSI color styling to the result of the enclosed pattern.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractStyleNameConverter.Black
Black style pattern converter.static class
AbstractStyleNameConverter.Blue
Blue style pattern converter.static class
AbstractStyleNameConverter.Cyan
Cyan style pattern converter.static class
AbstractStyleNameConverter.Green
Green style pattern converter.static class
AbstractStyleNameConverter.Magenta
Magenta style pattern converter.static class
AbstractStyleNameConverter.Red
Red style pattern converter.static class
AbstractStyleNameConverter.White
White style pattern converter.static class
AbstractStyleNameConverter.Yellow
Yellow style pattern converter.
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
LOGGER
-
Fields inherited from interface org.apache.logging.log4j.core.pattern.PatternConverter
CATEGORY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractStyleNameConverter(String name, List<PatternFormatter> formatters, String styling)
Constructs the converter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
format(LogEvent event, StringBuilder toAppendTo)
Formats an event into a string buffer.protected static <T extends AbstractStyleNameConverter>
TnewInstance(Class<T> asnConverterClass, String name, Configuration config, String[] options)
Gets an instance of the class (called via reflection).-
Methods inherited from class org.apache.logging.log4j.core.pattern.LogEventPatternConverter
format, handlesThrowable, isVariable
-
Methods inherited from class org.apache.logging.log4j.core.pattern.AbstractPatternConverter
getName, getStyleClass
-
-
-
-
Constructor Detail
-
AbstractStyleNameConverter
protected AbstractStyleNameConverter(String name, List<PatternFormatter> formatters, 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(Class<T> asnConverterClass, String name, Configuration config, 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
-
format
public void format(LogEvent event, StringBuilder toAppendTo)
Formats an event into a string buffer.- Specified by:
format
in classLogEventPatternConverter
- Parameters:
event
- event to format, may not be null.toAppendTo
- string buffer to which the formatted event will be appended. May not be null.
-
-