public final class Formatters
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
Formatters.JustifyingFormatStep |
(package private) static class |
Formatters.Segment |
private static class |
Formatters.SegmentedFormatStep |
Modifier and Type | Field and Description |
---|---|
private static boolean |
DEFAULT_TRUNCATE_BEGINNING |
private static java.lang.String |
NEW_LINE |
private static java.util.logging.Formatter |
NULL_FORMATTER |
private static java.util.regex.Pattern |
PRECISION_INT_PATTERN |
private static java.lang.String |
separatorString |
static java.lang.String |
THREAD_ID |
Modifier | Constructor and Description |
---|---|
private |
Formatters() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
applySegments(int count,
java.lang.String subject)
Apply up to
count trailing segments of the given string to the given builder . |
private static java.lang.String |
applySegments(java.lang.String precision,
java.lang.String subject)
Apply up to
precision trailing segments of the given string to the given builder . |
static FormatStep |
classNameFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth,
java.lang.String precision)
Create a format step which emits the source class name with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
classNameFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth,
java.lang.String precision)
Create a format step which emits the source class name with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
dateFormatStep(java.lang.String formatString,
boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the date of the log record with the given justification rules.
|
static FormatStep |
dateFormatStep(java.util.TimeZone timeZone,
java.lang.String formatString,
boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the date of the log record with the given justification rules.
|
static FormatStep |
dateFormatStep(java.util.TimeZone timeZone,
java.lang.String formatString,
boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the date of the log record with the given justification rules.
|
static FormatStep |
exceptionFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth,
java.lang.String argument,
boolean extended)
Create a format step which emits the stack trace of an exception with the given justification rules.
|
static FormatStep |
exceptionFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth,
boolean extended)
Create a format step which emits the stack trace of an exception with the given justification rules.
|
static FormatStep |
fileNameFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the source file name with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
fileNameFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the source file name with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
private static java.lang.String |
findHostname(java.util.Properties props,
java.util.Map<java.lang.String,java.lang.String> env,
boolean qualified) |
private static java.lang.String |
findQualifiedHostname(java.util.Properties props,
java.util.Map<java.lang.String,java.lang.String> env) |
static FormatStep |
formatColor(ColorMap colors,
java.lang.String color) |
(package private) static java.lang.String |
getJarName(java.net.URL resource,
java.lang.String classResourceName) |
static FormatStep |
hostnameFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth,
boolean qualified)
Create a format step which emits the hostname.
|
static FormatStep |
levelFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the log level name.
|
static FormatStep |
levelFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the log level name.
|
static FormatStep |
lineNumberFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the source file line number with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
lineNumberFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the source file line number with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
lineSeparatorFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the platform line separator.
|
static FormatStep |
lineSeparatorFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the platform line separator.
|
static FormatStep |
localizedLevelFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the localized log level name.
|
static FormatStep |
localizedLevelFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the localized log level name.
|
static FormatStep |
locationInformationFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the complete source location information with the given justification rules
(NOTE: call stack introspection introduces a significant performance penalty).
|
static FormatStep |
locationInformationFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the complete source location information with the given justification rules
(NOTE: call stack introspection introduces a significant performance penalty).
|
static FormatStep |
loggerNameFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth,
java.lang.String precision)
Create a format step which emits the logger name with the given justification rules.
|
static FormatStep |
loggerNameFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth,
java.lang.String precision)
Create a format step which emits the logger name with the given justification rules.
|
static FormatStep |
mdcFormatStep(java.lang.String key,
boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the MDC value associated with the given key of the log record.
|
static FormatStep |
mdcFormatStep(java.lang.String key,
boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the MDC value associated with the given key of the log record.
|
static FormatStep |
messageFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the formatted log message text with the given justification rules.
|
static FormatStep |
messageFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the formatted log message text with the given justification rules.
|
static FormatStep |
methodNameFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the source method name with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
methodNameFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the source method name with the given justification rules (NOTE: call stack
introspection introduces a significant performance penalty).
|
static FormatStep |
ndcFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth,
int count)
Create a format step which emits the NDC value of the log record.
|
static FormatStep |
ndcFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the NDC value of the log record.
|
static java.util.logging.Formatter |
nullFormatter()
Get the null formatter, which outputs nothing.
|
(package private) static java.util.Deque<java.lang.String> |
parseCategorySegments(java.lang.String category) |
(package private) static java.util.Map<java.lang.Integer,Formatters.Segment> |
parsePatternSegments(java.lang.String pattern) |
static FormatStep |
relativeTimeFormatStep(long baseTime,
boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the number of milliseconds since the given base time.
|
static FormatStep |
relativeTimeFormatStep(long baseTime,
boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the number of milliseconds since the given base time.
|
static FormatStep |
resourceKeyFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the log message resource key (if any) with the given justification rules.
|
static FormatStep |
resourceKeyFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the log message resource key (if any) with the given justification rules.
|
static FormatStep |
simpleMessageFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the formatted log message text (simple version, no exception traces) with the given justification rules.
|
static FormatStep |
simpleMessageFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the formatted log message text (simple version, no exception traces) with the given justification rules.
|
static FormatStep |
systemPropertyFormatStep(java.lang.String argument,
boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits a system property value associated with the given key.
|
static FormatStep |
textFormatStep(java.lang.String string)
Create a format step which simply emits the given string.
|
static FormatStep |
threadFormatStep(java.lang.String argument,
boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the id if
id is passed as the argument, otherwise the the thread name
is used. |
static FormatStep |
threadIdFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the id of the thread which originated the log record.
|
static FormatStep |
threadNameFormatStep(boolean leftJustify,
int minimumWidth,
boolean truncateBeginning,
int maximumWidth)
Create a format step which emits the name of the thread which originated the log record.
|
static FormatStep |
threadNameFormatStep(boolean leftJustify,
int minimumWidth,
int maximumWidth)
Create a format step which emits the name of the thread which originated the log record.
|
public static final java.lang.String THREAD_ID
private static final boolean DEFAULT_TRUNCATE_BEGINNING
private static final java.lang.String NEW_LINE
private static final java.util.regex.Pattern PRECISION_INT_PATTERN
private static final java.util.logging.Formatter NULL_FORMATTER
private static final java.lang.String separatorString
public static java.util.logging.Formatter nullFormatter()
public static FormatStep textFormatStep(java.lang.String string)
string
- the string to emitprivate static java.lang.String applySegments(int count, java.lang.String subject)
count
trailing segments of the given string to the given builder
.count
- the maximum number of segments to includesubject
- the subject stringprivate static java.lang.String applySegments(java.lang.String precision, java.lang.String subject)
precision
trailing segments of the given string to the given builder
. If the
precision contains non-integer valuesprecision
- the precision used tosubject
- the subject stringpublic static FormatStep loggerNameFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth, java.lang.String precision)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for noneprecision
- the argument used for the logger name, may be null
or contain dots to format the logger namepublic static FormatStep loggerNameFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth, java.lang.String precision)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for noneprecision
- the argument used for the logger name, may be null
or contain dots to format the
logger namepublic static FormatStep classNameFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth, java.lang.String precision)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for noneprecision
- the argument used for the class name, may be null
or contain dots to format the class namepublic static FormatStep classNameFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth, java.lang.String precision)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for noneprecision
- the argument used for the class name, may be null
or contain dots to format the
class namepublic static FormatStep dateFormatStep(java.util.TimeZone timeZone, java.lang.String formatString, boolean leftJustify, int minimumWidth, int maximumWidth)
timeZone
- the time zone to format toformatString
- the date format stringleftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep dateFormatStep(java.util.TimeZone timeZone, java.lang.String formatString, boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
timeZone
- the time zone to format toformatString
- the date format stringleftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep dateFormatStep(java.lang.String formatString, boolean leftJustify, int minimumWidth, int maximumWidth)
formatString
- the date format stringleftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep fileNameFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep fileNameFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep hostnameFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth, boolean qualified)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonequalified
- true
to use the fully qualified host name, false
to only use thepublic static FormatStep locationInformationFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep locationInformationFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep lineNumberFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep lineNumberFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep messageFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep messageFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep simpleMessageFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep simpleMessageFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep exceptionFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth, boolean extended)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for noneextended
- true
if the stack trace should attempt to include extended JAR version informationpublic static FormatStep exceptionFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth, java.lang.String argument, boolean extended)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for noneextended
- true
if the stack trace should attempt to include extended JAR version informationstatic java.lang.String getJarName(java.net.URL resource, java.lang.String classResourceName)
public static FormatStep resourceKeyFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep resourceKeyFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep methodNameFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep methodNameFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep lineSeparatorFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep lineSeparatorFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep levelFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep levelFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep localizedLevelFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep localizedLevelFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep relativeTimeFormatStep(long baseTime, boolean leftJustify, int minimumWidth, int maximumWidth)
baseTime
- the base time as milliseconds as per System.currentTimeMillis()
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep relativeTimeFormatStep(long baseTime, boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
baseTime
- the base time as milliseconds as per System.currentTimeMillis()
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep threadFormatStep(java.lang.String argument, boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
id
is passed as the argument, otherwise the the thread name
is used.argument
- the argument which may be id
to indicate the thread id or null
to
indicate the thread nameleftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep threadIdFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep threadNameFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep threadNameFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep ndcFormatStep(boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep ndcFormatStep(boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth, int count)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonecount
- the limit to the number of segments to formatpublic static FormatStep mdcFormatStep(java.lang.String key, boolean leftJustify, int minimumWidth, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonemaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep mdcFormatStep(java.lang.String key, boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonepublic static FormatStep formatColor(ColorMap colors, java.lang.String color)
public static FormatStep systemPropertyFormatStep(java.lang.String argument, boolean leftJustify, int minimumWidth, boolean truncateBeginning, int maximumWidth)
argument
- the argument that may be a key or key with a default value separated by a colon, cannot
be null
leftJustify
- true
to left justify, false
to right justifyminimumWidth
- the minimum field width, or 0 for nonetruncateBeginning
- true
to truncate the beginning, otherwise false
to truncate the endmaximumWidth
- the maximum field width (must be greater than minimumFieldWidth
), or 0 for nonejava.lang.IllegalArgumentException
- if the argument
is null
java.lang.SecurityException
- if a security manager exists and its checkPropertyAccess
method doesn't
allow access to the specified system propertystatic java.util.Map<java.lang.Integer,Formatters.Segment> parsePatternSegments(java.lang.String pattern)
static java.util.Deque<java.lang.String> parseCategorySegments(java.lang.String category)
private static java.lang.String findHostname(java.util.Properties props, java.util.Map<java.lang.String,java.lang.String> env, boolean qualified)
private static java.lang.String findQualifiedHostname(java.util.Properties props, java.util.Map<java.lang.String,java.lang.String> env)