Package org.jboss.logmanager.formatters
Class PatternFormatter
- java.lang.Object
-
- java.util.logging.Formatter
-
- org.jboss.logmanager.ExtFormatter
-
- org.jboss.logmanager.formatters.MultistepFormatter
-
- org.jboss.logmanager.formatters.PatternFormatter
-
public class PatternFormatter extends MultistepFormatter
A formatter which uses a text pattern to format messages.
-
-
Constructor Summary
Constructors Constructor Description PatternFormatter()
Construct a new instance.PatternFormatter(java.lang.String pattern)
Construct a new instance.PatternFormatter(java.lang.String pattern, java.lang.String colors)
Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getColors()
java.lang.String
getPattern()
Get the current format pattern.void
setColors(java.lang.String colors)
Set the color map to use for log levels when %K{level} is used.void
setPattern(java.lang.String pattern)
Set the format pattern.-
Methods inherited from class org.jboss.logmanager.formatters.MultistepFormatter
format, getSteps, setSteps
-
Methods inherited from class org.jboss.logmanager.ExtFormatter
format
-
-
-
-
Field Detail
-
pattern
private volatile java.lang.String pattern
-
colors
private volatile ColorMap colors
-
-
Constructor Detail
-
PatternFormatter
public PatternFormatter()
Construct a new instance.
-
PatternFormatter
public PatternFormatter(java.lang.String pattern)
Construct a new instance.- Parameters:
pattern
- the initial pattern
-
PatternFormatter
public PatternFormatter(java.lang.String pattern, java.lang.String colors)
Construct a new instance.- Parameters:
pattern
- the initial patterncolors
- the color map to use
-
-
Method Detail
-
getPattern
public java.lang.String getPattern()
Get the current format pattern.- Returns:
- the pattern
-
setPattern
public void setPattern(java.lang.String pattern)
Set the format pattern.- Parameters:
pattern
- the pattern
-
setColors
public void setColors(java.lang.String colors)
Set the color map to use for log levels when %K{level} is used.The format is level:color,level:color,...
Where level is either a numerical value or one of the following constants:
fatal error severe warn warning info config debug trace fine finer finest Color is one of the following constants:
clear black red green yellow blue magenta cyan white brightblack brightred brightgreen brightyellow brightblue brightmagenta brightcyan brightwhite - Parameters:
colors
- a colormap expression string described above
-
getColors
public java.lang.String getColors()
-
-