@Plugin(name="style", category="Converter") public final class StyleConverter extends LogEventPatternConverter implements AnsiConverter
To disable ANSI output unconditionally, specify an additional option disableAnsi=true, or to
disable ANSI output if no console is detected, specify option noConsoleNoAnsi=true.
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
defaultStyle |
private boolean |
noAnsi |
private java.util.List<PatternFormatter> |
patternFormatters |
private java.lang.String |
style |
LOGGERCATEGORY| Modifier | Constructor and Description |
|---|---|
private |
StyleConverter(java.util.List<PatternFormatter> patternFormatters,
java.lang.String style,
boolean noAnsi)
Constructs the converter.
|
| Modifier and Type | Method and Description |
|---|---|
void |
format(LogEvent event,
java.lang.StringBuilder toAppendTo)
Formats an event into a string buffer.
|
boolean |
handlesThrowable()
Normally pattern converters are not meant to handle Exceptions although few pattern converters might.
|
static StyleConverter |
newInstance(Configuration config,
java.lang.String[] options)
Gets an instance of the class.
|
java.lang.String |
toString()
Returns a String suitable for debugging.
|
format, isVariablegetName, getStyleClassprivate final java.util.List<PatternFormatter> patternFormatters
private final boolean noAnsi
private final java.lang.String style
private final java.lang.String defaultStyle
private StyleConverter(java.util.List<PatternFormatter> patternFormatters, java.lang.String style, boolean noAnsi)
patternFormatters - The PatternFormatters to generate the text to manipulate.style - The style that should encapsulate the pattern.noAnsi - If true, do not output ANSI escape codes.public static StyleConverter newInstance(Configuration config, java.lang.String[] options)
config - The current Configuration.options - pattern options, may be null. If first element is "short", only the first line of the throwable will
be formatted.public void format(LogEvent event, java.lang.StringBuilder toAppendTo)
format in class LogEventPatternConverterevent - event to format, may not be null.toAppendTo - string buffer to which the formatted event will be appended. May not be null.public boolean handlesThrowable()
LogEventPatternConverterBy examining the return values for this method, the containing layout will determine whether it handles throwables or not.
handlesThrowable in class LogEventPatternConverterpublic java.lang.String toString()
toString in class java.lang.Object