You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/01/03 20:19:46 UTC
[camel] 01/03: CAMEL-14354: LogProcessor should avoid string.format
in some use-cases as it allocates too much objects.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 32535554ed6d06c2d39516848fc79d924dbdcb33
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jan 3 17:19:03 2020 +0100
CAMEL-14354: LogProcessor should avoid string.format in some use-cases as it allocates too much objects.
---
.../apache/camel/support/processor/DefaultExchangeFormatter.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/processor/DefaultExchangeFormatter.java b/core/camel-support/src/main/java/org/apache/camel/support/processor/DefaultExchangeFormatter.java
index 8eef6fa..2679243e 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/processor/DefaultExchangeFormatter.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/processor/DefaultExchangeFormatter.java
@@ -83,12 +83,12 @@ public class DefaultExchangeFormatter implements ExchangeFormatter {
private String style(String label) {
if (style == OutputStyle.Default) {
if (multiline) {
- return String.format(" %s: ", label);
+ return " " + label + ": ";
} else {
- return String.format(", %s: ", label);
+ return ", " + label + ": ";
}
} else if (style == OutputStyle.Tab) {
- return String.format("\t%s: ", label);
+ return "'t" + label + ": " ;
} else {
return String.format("\t%-20s", label);
}