vy commented on a change in pull request #460:
URL: https://github.com/apache/logging-log4j2/pull/460#discussion_r559789496
##########
File path:
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxyRenderer.java
##########
@@ -148,11 +154,14 @@ private static void formatEntry(final
ExtendedStackTraceElement extStackTraceEle
textRenderer.render(lineSeparator, sb, "Text");
}
- private static boolean ignoreElement(final StackTraceElement element,
final List<String> ignorePackages) {
- if (ignorePackages != null) {
- final String className = element.getClassName();
- for (final String pkg : ignorePackages) {
- if (className.startsWith(pkg)) {
+ private static boolean elementStartsWith(final StackTraceElement element,
final List<String> packagesOrStartFrames, boolean includeMethodName) {
+ if (packagesOrStartFrames != null) {
+ String className = element.getClassName();
+ if (includeMethodName) { // support startFrames
+ className += "." + element.getMethodName();
+ }
+ for (final String item : packagesOrStartFrames) {
Review comment:
Prefer an index-based iteration instead if you want to avoid the
iterator allocation at each call.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]