Class StackTraceCompacter
java.lang.Object
com.tridion.util.exceptions.compacter.impl.StackTraceCompacter
This class may compact given stacktrace into short form by removing similar rows and
replacing them into single one. For instance for spring framework + hibernate stacktrace usually
more that 100 lines, mostly all of them are from those frameworks. After compacting stacktrace may
turn into 5 lines only.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRuleToBeLeftExpanded(String ruleName, String[] rule) Allows to add rules which will always be expanded.voidaddRuleToCollapse(String compactedName, String[] rule) Allows to add user defined rule for compacting rows.This method is providing compacted stacktrace in printable format.List<com.tridion.util.exceptions.compacter.impl.StackTraceCompacter.ProcessorRule>voidTou have to use this method as starting point.
-
Constructor Details
-
StackTraceCompacter
public StackTraceCompacter() -
StackTraceCompacter
-
-
Method Details
-
init
Tou have to use this method as starting point. Then call generateString() to get the magic.- Parameters:
throwable- given exception to be compacted.
-
addRuleToCollapse
Allows to add user defined rule for compacting rows.- Parameters:
compactedName- name of rule - will be visible in stacktrace.rule- in fact array of texts, you do not want to see expanded in stacktrace.
-
addRuleToBeLeftExpanded
Allows to add rules which will always be expanded. Usually it's not necessary, but it can help processing faster.- Parameters:
ruleName- just name of rule, it's not used anywhere.rule- in fact array of texts, you want to see expanded in stacktracea.
-
getAllRules
public List<com.tridion.util.exceptions.compacter.impl.StackTraceCompacter.ProcessorRule> getAllRules() -
generateString
This method is providing compacted stacktrace in printable format.- Returns:
-