Top Description Inners Fields Constructors Methods
org.jboss.logmanager.formatters

public Class ColorPatternFormatter

extends PatternFormatter
Class Inheritance
Static Imports
java.lang.Math.abs

A pattern formatter that colorizes the pattern in a fixed manner.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final int
private final Printf

Constructor Summary

AccessConstructor and Description
public
public
public
public
ColorPatternFormatter(int darken, final String pattern)

Method Summary

Modifier and TypeMethod and Description
private FormatStep
colorize(final FormatStep step)

private String
colorizePlain(final String str)

public String
formatMessage(final LogRecord
the log record containing the raw message
logRecord
)

Overrides org.jboss.logmanager.ExtFormatter.formatMessage.

Localize and format the message string from a log record.

public void
setSteps(final FormatStep[]
the new format steps
steps
)

Overrides org.jboss.logmanager.formatters.MultistepFormatter.setSteps.

Assign new format steps.

Inherited from org.jboss.logmanager.formatters.PatternFormatter:
getColorsgetPatternsetColorssetPattern

Field Detail

darkenback to summary
private final int darken
printfback to summary
private final Printf printf

Constructor Detail

ColorPatternFormatterback to summary
public ColorPatternFormatter()
ColorPatternFormatterback to summary
public ColorPatternFormatter(final String pattern)
ColorPatternFormatterback to summary
public ColorPatternFormatter(int darken)
ColorPatternFormatterback to summary
public ColorPatternFormatter(int darken, final String pattern)

Method Detail

colorizeback to summary
private FormatStep colorize(final FormatStep step)
colorizePlainback to summary
private String colorizePlain(final String str)
formatMessageback to summary
public String formatMessage(final LogRecord logRecord)

Overrides org.jboss.logmanager.ExtFormatter.formatMessage.

Doc from java.util.logging.Formatter.formatMessage.

Localize and format the message string from a log record. This method is provided as a convenience for Formatter subclasses to use when they are performing formatting.

The message string is first localized to a format string using the record's ResourceBundle. (If there is no ResourceBundle, or if the message key is not found, then the key is used as the format string.) The format String uses java.text style formatting.

  • If there are no parameters, no formatter is used.
  • Otherwise, if the string contains "{<digit>" where <digit> is in [0-9], java.text.MessageFormat is used to format the string.
  • Otherwise no formatting is performed.
Parameters
logRecord:LogRecord

the log record containing the raw message

Returns:String

a localized and formatted message

setStepsback to summary
public void setSteps(final FormatStep[] steps)

Overrides org.jboss.logmanager.formatters.MultistepFormatter.setSteps.

Doc from org.jboss.logmanager.formatters.MultistepFormatter.setSteps.

Assign new format steps.

Parameters
steps:FormatStep[]

the new format steps

org.jboss.logmanager.formatters back to summary

pack-priv final Class ColorPatternFormatter.ColorStep

extends Object
implements FormatStep
Class Inheritance
  • java.lang.Object
  • org.jboss.logmanager.formatters.ColorPatternFormatter.ColorStep
All Implemented Interfaces
org.jboss.logmanager.formatters.FormatStep

Field Summary

Modifier and TypeField and Description
private final int
b

private final FormatStep
private final int
g

private final int
r

private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
ColorStep(final FormatStep delegate, final int r, final int g, final int b, final int darken)

Method Summary

Modifier and TypeMethod and Description
public int
estimateLength()

Implements org.jboss.logmanager.formatters.FormatStep.estimateLength.

Emit an estimate of the length of data which this step will produce.

public FormatStep.ItemType
getItemType()

Overrides default org.jboss.logmanager.formatters.FormatStep.getItemType.

Get the item type of this step.

public boolean
isCallerInformationRequired()

Overrides default org.jboss.logmanager.formatters.FormatStep.isCallerInformationRequired.

Indicates whether or not caller information is required for this format step.

public void
render(final Formatter
the formatter to render to
formatter
,
final StringBuilder
the string builder to append to
builder
,
final ExtLogRecord
the record being rendered
record
)

Overrides default org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record to the given formatter.

public void
render(final StringBuilder
the string builder to append to
builder
,
final ExtLogRecord
the record being rendered
record
)

Implements org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bback to summary
private final int b
delegateback to summary
private final FormatStep delegate
gback to summary
private final int g
rback to summary
private final int r
trueColorback to summary
private final boolean trueColor

Constructor Detail

ColorStepback to summary
pack-priv ColorStep(final FormatStep delegate, final int r, final int g, final int b, final int darken)

Method Detail

estimateLengthback to summary
public int estimateLength()

Implements org.jboss.logmanager.formatters.FormatStep.estimateLength.

Doc from org.jboss.logmanager.formatters.FormatStep.estimateLength.

Emit an estimate of the length of data which this step will produce. The more accurate the estimate, the more likely the format operation will be performant.

Returns:int

an estimate

getItemTypeback to summary
public FormatStep.ItemType getItemType()

Overrides default org.jboss.logmanager.formatters.FormatStep.getItemType.

Doc from org.jboss.logmanager.formatters.FormatStep.getItemType.

Get the item type of this step.

Returns:FormatStep.ItemType

the item type

isCallerInformationRequiredback to summary
public boolean isCallerInformationRequired()

Overrides default org.jboss.logmanager.formatters.FormatStep.isCallerInformationRequired.

Doc from org.jboss.logmanager.formatters.FormatStep.isCallerInformationRequired.

Indicates whether or not caller information is required for this format step.

Returns:boolean

true if caller information is required, otherwise false

renderback to summary
public void render(final Formatter formatter, final StringBuilder builder, final ExtLogRecord record)

Overrides default org.jboss.logmanager.formatters.FormatStep.render.

Doc from org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record to the given formatter.

Parameters
formatter:Formatter

the formatter to render to

builder:StringBuilder

the string builder to append to

record:ExtLogRecord

the record being rendered

renderback to summary
public void render(final StringBuilder builder, final ExtLogRecord record)

Implements org.jboss.logmanager.formatters.FormatStep.render.

Doc from org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record.

Parameters
builder:StringBuilder

the string builder to append to

record:ExtLogRecord

the record being rendered

org.jboss.logmanager.formatters back to summary

pack-priv final Class ColorPatternFormatter.LevelColorStep

extends Object
implements FormatStep
Class Inheritance
  • java.lang.Object
  • org.jboss.logmanager.formatters.ColorPatternFormatter.LevelColorStep
All Implemented Interfaces
org.jboss.logmanager.formatters.FormatStep

Field Summary

Modifier and TypeField and Description
private final int
private final FormatStep
private static final int
private static final int
private static final int
private final boolean

Constructor Summary

AccessConstructor and Description
pack-priv
LevelColorStep(final FormatStep delegate, final int darken)

Method Summary

Modifier and TypeMethod and Description
public int
estimateLength()

Implements org.jboss.logmanager.formatters.FormatStep.estimateLength.

Emit an estimate of the length of data which this step will produce.

public boolean
isCallerInformationRequired()

Overrides default org.jboss.logmanager.formatters.FormatStep.isCallerInformationRequired.

Indicates whether or not caller information is required for this format step.

public void
render(final Formatter
the formatter to render to
formatter
,
final StringBuilder
the string builder to append to
builder
,
final ExtLogRecord
the record being rendered
record
)

Overrides default org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record to the given formatter.

public void
render(final StringBuilder
the string builder to append to
builder
,
final ExtLogRecord
the record being rendered
record
)

Implements org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

darkenback to summary
private final int darken
delegateback to summary
private final FormatStep delegate
LARGEST_LEVELback to summary
private static final int LARGEST_LEVEL
SATURATIONback to summary
private static final int SATURATION
SMALLEST_LEVELback to summary
private static final int SMALLEST_LEVEL
trueColorback to summary
private final boolean trueColor

Constructor Detail

LevelColorStepback to summary
pack-priv LevelColorStep(final FormatStep delegate, final int darken)

Method Detail

estimateLengthback to summary
public int estimateLength()

Implements org.jboss.logmanager.formatters.FormatStep.estimateLength.

Doc from org.jboss.logmanager.formatters.FormatStep.estimateLength.

Emit an estimate of the length of data which this step will produce. The more accurate the estimate, the more likely the format operation will be performant.

Returns:int

an estimate

isCallerInformationRequiredback to summary
public boolean isCallerInformationRequired()

Overrides default org.jboss.logmanager.formatters.FormatStep.isCallerInformationRequired.

Doc from org.jboss.logmanager.formatters.FormatStep.isCallerInformationRequired.

Indicates whether or not caller information is required for this format step.

Returns:boolean

true if caller information is required, otherwise false

renderback to summary
public void render(final Formatter formatter, final StringBuilder builder, final ExtLogRecord record)

Overrides default org.jboss.logmanager.formatters.FormatStep.render.

Doc from org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record to the given formatter.

Parameters
formatter:Formatter

the formatter to render to

builder:StringBuilder

the string builder to append to

record:ExtLogRecord

the record being rendered

renderback to summary
public void render(final StringBuilder builder, final ExtLogRecord record)

Implements org.jboss.logmanager.formatters.FormatStep.render.

Doc from org.jboss.logmanager.formatters.FormatStep.render.

Render a part of the log record.

Parameters
builder:StringBuilder

the string builder to append to

record:ExtLogRecord

the record being rendered