ppkarwasz commented on code in PR #2691:
URL: https://github.com/apache/logging-log4j2/pull/2691#discussion_r1654743393
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java:
##########
@@ -401,15 +423,17 @@ public String getExtendedStackTraceAsString(
* @param textRenderer The message renderer.
* @param suffix Append this to the end of each stack frame.
* @param lineSeparator The end-of-line separator.
+ * @param maxLineCount The total line count of final result
*/
public void formatExtendedStackTraceTo(
final StringBuilder sb,
final List<String> ignorePackages,
final TextRenderer textRenderer,
final String suffix,
- final String lineSeparator) {
+ final String lineSeparator,
+ final Integer maxLineCount) {
Review Comment:
…this is causing a breaking change.
You need to **deprecate**, but keep the 5-param version of
`formatExtendedStackTraceTo`:
```java
/**
* @deprecated since 2.24.0
*/
@Deprecated
public void formatExtendedStackTraceTo(
final StringBuilder sb,
final List<String> ignorePackages,
final TextRenderer textRenderer,
final String suffix,
final String lineSeparator) {
formatExtendedStackTraceTo(sb, ignorePackages, textRenderer, suffix,
lineSeparator, null);
}
```
and then…
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java:
##########
@@ -295,12 +295,35 @@ public String getCauseStackTraceAsString(
final List<String> ignorePackages,
final TextRenderer textRenderer,
final String suffix,
- final String lineSeparator) {
+ final String lineSeparator,
+ final Integer linesToKeep) {
final StringBuilder sb = new StringBuilder();
- ThrowableProxyRenderer.formatCauseStackTrace(this, sb, ignorePackages,
textRenderer, suffix, lineSeparator);
+ ThrowableProxyRenderer.formatCauseStackTraceTo(
+ this, sb, ignorePackages, textRenderer, suffix, lineSeparator,
linesToKeep);
return sb.toString();
}
+ /**
+ * Formats the stack trace with cause exception.
+ *
+ * @param sb Destination.
+ * @param ignorePackages List of packages to be ignored in the trace.
+ * @param textRenderer The message renderer.
+ * @param suffix Append this to the end of each stack frame.
+ * @param lineSeparator The end-of-line separator.
+ * @param linesToKeep The total line count of final result
+ */
+ public void formatCauseStackTraceTo(
Review Comment:
This is not the **major** version change you are looking for…
##########
log4j-core/src/main/java/org/apache/logging/log4j/core/package-info.java:
##########
@@ -18,7 +18,7 @@
* Implementation of Log4j 2.
*/
@Export
-@Version("2.24.0")
+@Version("3.0.0")
Review Comment:
…revert this change, since the `2.x` branch can not have breaking changes
(packages with version `3.0.0`).
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]