Class ThrowableFormatOptions
- java.lang.Object
-
- org.apache.logging.log4j.core.impl.ThrowableFormatOptions
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLASS_NAME
protected static ThrowableFormatOptions
DEFAULT
Default instance ofThrowableFormatOptions
.static String
FILE_NAME
static String
LINE_NUMBER
static String
LOCALIZED_MESSAGE
static String
MESSAGE
static String
METHOD_NAME
-
Constructor Summary
Constructors Modifier Constructor Description protected
ThrowableFormatOptions()
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allLines()
Determines if all lines should be printed.boolean
anyLines()
Determines if any lines should be printed.List<String>
getIgnorePackages()
Returns the list of packages to ignore (filter out).int
getLines()
Returns the number of lines to write.String
getSeparator()
Returns the stack trace separator.String
getSuffix()
TextRenderer
getTextRenderer()
Returns the message rendered.boolean
hasPackages()
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.String
toString()
-
-
-
Field Detail
-
DEFAULT
protected static final ThrowableFormatOptions DEFAULT
Default instance ofThrowableFormatOptions
.
-
CLASS_NAME
public static final String CLASS_NAME
- See Also:
- Constant Field Values
-
METHOD_NAME
public static final String METHOD_NAME
- See Also:
- Constant Field Values
-
LINE_NUMBER
public static final String LINE_NUMBER
- See Also:
- Constant Field Values
-
FILE_NAME
public static final String FILE_NAME
- See Also:
- Constant Field Values
-
MESSAGE
public static final String MESSAGE
- See Also:
- Constant Field Values
-
LOCALIZED_MESSAGE
public static final String LOCALIZED_MESSAGE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
protected ThrowableFormatOptions(List<String> packages)
Constructs the options for printing stack trace.- Parameters:
packages
- The packages to filter.
-
ThrowableFormatOptions
protected ThrowableFormatOptions()
Constructs the options for printing stack trace.
-
-
Method Detail
-
getLines
public int getLines()
Returns the number of lines to write.- Returns:
- The number of lines to write.
-
getSeparator
public String getSeparator()
Returns the stack trace separator.- Returns:
- The stack trace separator.
-
getTextRenderer
public TextRenderer getTextRenderer()
Returns the message rendered.- Returns:
- the message rendered.
-
getIgnorePackages
public List<String> 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.
-
newInstance
public static ThrowableFormatOptions newInstance(String[] options)
Creates a new instance based on the array of options.- Parameters:
options
- The array of options.- Returns:
- A new initialized instance.
-
getSuffix
public String getSuffix()
-
-