Class ThrowableFormatOptions
java.lang.Object
org.apache.logging.log4j.core.impl.ThrowableFormatOptions
Contains options which control how a
Throwable
pattern is formatted.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
protected static final ThrowableFormatOptions
Default instance ofThrowableFormatOptions
.private static final int
static final String
private static final String
Format the whole stack trace.The list of packages to filter.static final String
private final int
The number of lines to write.static final String
static final String
static final String
private static final String
Do not format the exception.private final String
The stack trace separator.private static final String
Format only the first line of the throwable.private final String
private final TextRenderer
ANSI renderer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructs the options for printing stack trace.protected
ThrowableFormatOptions
(int lines, String separator, List<String> ignorePackages, TextRenderer textRenderer, String suffix) Constructs the options for printing stack trace.protected
ThrowableFormatOptions
(List<String> packages) Constructs the options for printing stack trace. -
Method Summary
Modifier and TypeMethodDescriptionboolean
allLines()
Determines if all lines should be printed.boolean
anyLines()
Determines if any lines should be printed.Returns the list of packages to ignore (filter out).int
getLines()
Returns the number of lines to write.Returns the stack trace separator.Returns the message rendered.boolean
Determines if there are any packages to filter.int
minLines
(int maxLines) Returns the minimum between the lines and the max lines.static ThrowableFormatOptions
newInstance
(String[] options) Creates a new instance based on the array of options.toString()
-
Field Details
-
DEFAULT_LINES
private static final int DEFAULT_LINES- See Also:
-
DEFAULT
Default instance ofThrowableFormatOptions
. -
FULL
Format the whole stack trace.- See Also:
-
NONE
Do not format the exception.- See Also:
-
SHORT
Format only the first line of the throwable.- See Also:
-
textRenderer
ANSI renderer -
lines
private final int linesThe number of lines to write. -
separator
The stack trace separator. -
suffix
-
ignorePackages
The list of packages to filter. -
CLASS_NAME
- See Also:
-
METHOD_NAME
- See Also:
-
LINE_NUMBER
- See Also:
-
FILE_NAME
- See Also:
-
MESSAGE
- See Also:
-
LOCALIZED_MESSAGE
- See Also:
-
-
Constructor Details
-
ThrowableFormatOptions
protected ThrowableFormatOptions(int lines, String separator, List<String> ignorePackages, TextRenderer textRenderer, String suffix) Constructs the options for printing stack trace.- Parameters:
lines
- The number of lines.separator
- The stack trace separator.ignorePackages
- The packages to filter.textRenderer
- The ANSI renderersuffix
-
-
ThrowableFormatOptions
Constructs the options for printing stack trace.- Parameters:
packages
- The packages to filter.
-
ThrowableFormatOptions
protected ThrowableFormatOptions()Constructs the options for printing stack trace.
-
-
Method Details
-
getLines
public int getLines()Returns the number of lines to write.- Returns:
- The number of lines to write.
-
getSeparator
Returns the stack trace separator.- Returns:
- The stack trace separator.
-
getTextRenderer
Returns the message rendered.- Returns:
- the message rendered.
-
getIgnorePackages
Returns the list of packages to ignore (filter out).- Returns:
- The list of packages to ignore (filter out).
-
allLines
public boolean allLines()Determines if all lines should be printed.- Returns:
- true for all lines, false otherwise.
-
anyLines
public boolean anyLines()Determines if any lines should be printed.- Returns:
- true for any lines, false otherwise.
-
minLines
public int minLines(int maxLines) Returns the minimum between the lines and the max lines.- Parameters:
maxLines
- The maximum number of lines.- Returns:
- The number of lines to print.
-
hasPackages
public boolean hasPackages()Determines if there are any packages to filter.- Returns:
- true if there are packages, false otherwise.
-
toString
-
newInstance
Creates a new instance based on the array of options.- Parameters:
options
- The array of options.- Returns:
- A new initialized instance.
-
getSuffix
-