You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2016/07/25 15:56:43 UTC
[14/50] [abbrv] logging-log4j2 git commit: Javadoc. Better pnames.
Javadoc. Better pnames.
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/8bc8aa81
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/8bc8aa81
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/8bc8aa81
Branch: refs/heads/LOG4J-1181
Commit: 8bc8aa81f3ab3f85195f155f37a233080293ec3e
Parents: 04da51b
Author: ggregory <gg...@apache.org>
Authored: Thu Jul 7 01:28:20 2016 -0700
Committer: ggregory <gg...@apache.org>
Committed: Thu Jul 7 01:28:20 2016 -0700
----------------------------------------------------------------------
.../log4j/core/pattern/HtmlMessageRenderer.java | 66 ++++++++++----------
.../core/pattern/JAnsiMessageRenderer.java | 16 ++---
2 files changed, 42 insertions(+), 40 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8bc8aa81/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HtmlMessageRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HtmlMessageRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HtmlMessageRenderer.java
index bdbfa26..be62365 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HtmlMessageRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HtmlMessageRenderer.java
@@ -1,33 +1,33 @@
-/*
- * 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.core.pattern;
-
-/**
- * MIGHT BE DELETED ANY MOMENT FROM THIS BRANCH.
- */
-public final class HtmlMessageRenderer implements MessageRenderer {
-
- public HtmlMessageRenderer(String[] formats) {
- // TODO Auto-generated constructor stub
- }
-
- @Override
- public void render(StringBuilder source, StringBuilder target) {
- // TODO Auto-generated method stub
- }
-
-}
+/*
+ * 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.core.pattern;
+
+/**
+ * TODO Renders an input as HTML output.
+ */
+public final class HtmlMessageRenderer implements MessageRenderer {
+
+ public HtmlMessageRenderer(String[] formats) {
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public void render(StringBuilder input, StringBuilder output) {
+ // TODO Auto-generated method stub
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/8bc8aa81/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiMessageRenderer.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiMessageRenderer.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiMessageRenderer.java
index 311c1cf..120f19b 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiMessageRenderer.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/JAnsiMessageRenderer.java
@@ -26,6 +26,8 @@ import org.fusesource.jansi.AnsiRenderer;
import org.fusesource.jansi.AnsiRenderer.Code;
/**
+ * Renders an input as ANSI escaped output.
+ *
* Uses the JAnsi rendering syntax to render a message into an ANSI escaped string.
*
* The syntax for embedded ANSI codes is:
@@ -157,7 +159,7 @@ public final class JAnsiMessageRenderer implements MessageRenderer {
}
@Override
- public void render(final StringBuilder input, final StringBuilder target) throws IllegalArgumentException {
+ public void render(final StringBuilder input, final StringBuilder output) throws IllegalArgumentException {
int i = 0;
int j, k;
@@ -165,17 +167,17 @@ public final class JAnsiMessageRenderer implements MessageRenderer {
j = input.indexOf(beginToken, i);
if (j == -1) {
if (i == 0) {
- target.append(input);
+ output.append(input);
return;
}
- target.append(input.substring(i, input.length()));
+ output.append(input.substring(i, input.length()));
return;
}
- target.append(input.substring(i, j));
+ output.append(input.substring(i, j));
k = input.indexOf(endToken, j);
if (k == -1) {
- target.append(input);
+ output.append(input);
return;
}
j += beginTokenLen;
@@ -183,12 +185,12 @@ public final class JAnsiMessageRenderer implements MessageRenderer {
final String[] items = spec.split(AnsiRenderer.CODE_TEXT_SEPARATOR, 2);
if (items.length == 1) {
- target.append(input);
+ output.append(input);
return;
}
final String replacement = render(items[1], items[0].split(","));
- target.append(replacement);
+ output.append(replacement);
i = k + endTokenLen;
}