Repository: logging-log4j2 Updated Branches: refs/heads/master 39114a7af -> c9a92d9de
Add missing license header. Message should implement StringBuilderFormattable Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/c9a92d9d Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/c9a92d9d Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/c9a92d9d Branch: refs/heads/master Commit: c9a92d9de75f73390b3afa2ca9ade3097e478281 Parents: 39114a7 Author: Ralph Goers <rgo...@nextiva.com> Authored: Sun Aug 20 19:24:29 2017 -0700 Committer: Ralph Goers <rgo...@nextiva.com> Committed: Sun Aug 20 19:24:29 2017 -0700 ---------------------------------------------------------------------- .../apache/logging/log4j/util/ProcessIdUtil.java | 16 ++++++++++++++++ .../message/StructuredDataCollectionMessage.java | 16 ++++++++++++---- 2 files changed, 28 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c9a92d9d/log4j-api-java9/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java ---------------------------------------------------------------------- diff --git a/log4j-api-java9/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java b/log4j-api-java9/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java index 31ed6cf..e467413 100644 --- a/log4j-api-java9/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java +++ b/log4j-api-java9/src/main/java/org/apache/logging/log4j/util/ProcessIdUtil.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ package org.apache.logging.log4j.util; public class ProcessIdUtil { http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/c9a92d9d/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java index 3199193..216dbc4 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/message/StructuredDataCollectionMessage.java @@ -20,10 +20,13 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.apache.logging.log4j.util.StringBuilderFormattable; + /** * A collection of StructuredDataMessages. */ -public class StructuredDataCollectionMessage implements MessageCollectionMessage<StructuredDataMessage> { +public class StructuredDataCollectionMessage implements StringBuilderFormattable, + MessageCollectionMessage<StructuredDataMessage> { private List<StructuredDataMessage> structuredDataMessageList; @@ -39,9 +42,7 @@ public class StructuredDataCollectionMessage implements MessageCollectionMessage @Override public String getFormattedMessage() { StringBuilder sb = new StringBuilder(); - for (StructuredDataMessage msg : structuredDataMessageList) { - sb.append(msg.getFormattedMessage()); - } + formatTo(sb); return sb.toString(); } @@ -60,6 +61,13 @@ public class StructuredDataCollectionMessage implements MessageCollectionMessage } @Override + public void formatTo(StringBuilder buffer) { + for (StructuredDataMessage msg : structuredDataMessageList) { + msg.formatTo(buffer); + } + } + + @Override public Object[] getParameters() { List<Object[]> objectList = new ArrayList<>(); int count = 0;