Return-Path: X-Original-To: apmail-logging-commits-archive@minotaur.apache.org Delivered-To: apmail-logging-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C0E3A8257 for ; Wed, 7 Sep 2011 21:21:00 +0000 (UTC) Received: (qmail 18023 invoked by uid 500); 7 Sep 2011 21:21:00 -0000 Delivered-To: apmail-logging-commits-archive@logging.apache.org Received: (qmail 17999 invoked by uid 500); 7 Sep 2011 21:21:00 -0000 Mailing-List: contact commits-help@logging.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@logging.apache.org Delivered-To: mailing list commits@logging.apache.org Received: (qmail 17981 invoked by uid 99); 7 Sep 2011 21:21:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 21:21:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Sep 2011 21:20:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D6320238889B; Wed, 7 Sep 2011 21:20:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1166404 - in /logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j: ./ message/ spi/ status/ Date: Wed, 07 Sep 2011 21:20:36 -0000 To: commits@logging.apache.org From: rgoers@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110907212036.D6320238889B@eris.apache.org> Author: rgoers Date: Wed Sep 7 21:20:34 2011 New Revision: 1166404 URL: http://svn.apache.org/viewvc?rev=1166404&view=rev Log: Fix checkstyle errors in api Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerFactory.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/MarkerManager.java Wed Sep 7 21:20:34 2011 @@ -67,6 +67,9 @@ public final class MarkerManager { return markerMap.get(name); } + /** + * The actual Marker implementation. + */ private static class Log4JMarker implements Marker { private static final long serialVersionUID = 100L; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/ParameterizedMessage.java Wed Sep 7 21:20:34 2011 @@ -22,7 +22,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Date; import java.util.HashSet; -import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -35,8 +34,41 @@ import java.util.Set; * providing that this attribution remain. */ public class ParameterizedMessage implements Message, Serializable { + + /** + * Prefix for recursion. + */ + public static final String RECURSION_PREFIX = "[..."; + /** + * Suffix for recursion. + */ + public static final String RECURSION_SUFFIX = "...]"; + + /** + * Prefix for errors. + */ + public static final String ERROR_PREFIX = "[!!!"; + /** + * Separator for errors. + */ + public static final String ERROR_SEPARATOR = "=>"; + /** + * Separator for error messages. + */ + public static final String ERROR_MSG_SEPARATOR = ":"; + /** + * Suffix for errors. + */ + public static final String ERROR_SUFFIX = "!!!]"; + private static final long serialVersionUID = -665975803997290697L; + private static final int HASHVAL = 31; + + private static final char DELIM_START = '{'; + private static final char DELIM_STOP = '}'; + private static final char ESCAPE_CHAR = '\\'; + private String messagePattern; private String[] stringArgs; private transient Object[] argArray; @@ -69,7 +101,8 @@ public class ParameterizedMessage implem *

*

If the last argument is a Throwable and is NOT used up by a placeholder in the message pattern it is returned * in ParameterizedMessage.getThrowable() and won't be contained in the created String[].
- * If it is used up ParameterizedMessage.getThrowable() will return null even if the last argument was a Throwable!

+ * If it is used up ParameterizedMessage.getThrowable() will return null even if the last argument was a + * Throwable!

* * @param messagePattern the message pattern that to be checked for placeholders. * @param arguments the argument array to be converted. @@ -229,22 +262,10 @@ public class ParameterizedMessage implem public int hashCode() { int result = messagePattern != null ? messagePattern.hashCode() : 0; - result = 31 * result + (stringArgs != null ? Arrays.hashCode(stringArgs) : 0); + result = HASHVAL * result + (stringArgs != null ? Arrays.hashCode(stringArgs) : 0); return result; } - private static final char DELIM_START = '{'; - private static final char DELIM_STOP = '}'; - private static final char ESCAPE_CHAR = '\\'; - - public static final String RECURSION_PREFIX = "[..."; - public static final String RECURSION_SUFFIX = "...]"; - - public static final String ERROR_PREFIX = "[!!!"; - public static final String ERROR_SEPARATOR = "=>"; - public static final String ERROR_MSG_SEPARATOR = ":"; - public static final String ERROR_SUFFIX = "!!!]"; - /** * Replace placeholders in the given messagePattern with arguments. * @@ -372,7 +393,7 @@ public class ParameterizedMessage implem return (String) o; } StringBuilder str = new StringBuilder(); - Set dejaVu = new HashSet(); // that's actually a neat name ;) + Set dejaVu = new HashSet(); // that's actually a neat name ;) recursiveDeepToString(o, str, dejaVu); return str.toString(); } @@ -385,7 +406,8 @@ public class ParameterizedMessage implem *

* dejaVu is used in case of those container types to prevent an endless recursion. *

- * It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a behavior. + * It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a + * behavior. * They only check if the container is directly contained in itself, but not if a contained container contains the * original one. Because of that, Arrays.toString(Object[]) isn't safe either. * Confusing? Just read the last paragraph again and check the respective toString() implementation. @@ -397,7 +419,7 @@ public class ParameterizedMessage implem * @param str the StringBuilder that o will be appended to * @param dejaVu a list of container identities that were already used. */ - private static void recursiveDeepToString(Object o, StringBuilder str, Set dejaVu) { + private static void recursiveDeepToString(Object o, StringBuilder str, Set dejaVu) { if (o == null) { str.append("null"); return; @@ -435,14 +457,13 @@ public class ParameterizedMessage implem Object[] oArray = (Object[]) o; str.append("["); boolean first = true; - for (int i = 0; i < oArray.length; ++i) { - Object current = oArray[i]; + for (Object current : oArray) { if (first) { first = false; } else { str.append(", "); } - recursiveDeepToString(current, str, new HashSet(dejaVu)); + recursiveDeepToString(current, str, new HashSet(dejaVu)); } str.append("]"); } @@ -458,9 +479,8 @@ public class ParameterizedMessage implem Map oMap = (Map) o; str.append("{"); boolean isFirst = true; - Iterator iter = oMap.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry current = (Map.Entry) iter.next(); + for (Object o1 : oMap.entrySet()) { + Map.Entry current = (Map.Entry) o1; if (isFirst) { isFirst = false; } else { @@ -468,9 +488,9 @@ public class ParameterizedMessage implem } Object key = current.getKey(); Object value = current.getValue(); - recursiveDeepToString(key, str, new HashSet(dejaVu)); + recursiveDeepToString(key, str, new HashSet(dejaVu)); str.append("="); - recursiveDeepToString(value, str, new HashSet(dejaVu)); + recursiveDeepToString(value, str, new HashSet(dejaVu)); } str.append("}"); } @@ -484,15 +504,13 @@ public class ParameterizedMessage implem Collection oCol = (Collection) o; str.append("["); boolean isFirst = true; - Iterator iter = oCol.iterator(); - while (iter.hasNext()) { - Object current = iter.next(); + for (Object anOCol : oCol) { if (isFirst) { isFirst = false; } else { str.append(", "); } - recursiveDeepToString(current, str, new HashSet(dejaVu)); + recursiveDeepToString(anOCol, str, new HashSet(dejaVu)); } str.append("]"); } @@ -505,8 +523,7 @@ public class ParameterizedMessage implem // it's just some other Object, we can only use toString(). try { str.append(o.toString()); - } - catch (Throwable t) { + } catch (Throwable t) { str.append(ERROR_PREFIX); str.append(identityToString(o)); str.append(ERROR_SEPARATOR); @@ -534,7 +551,8 @@ public class ParameterizedMessage implem * objects. (This is typically implemented by converting the internal * address of the object into an integer, but this implementation * technique is not required by the - * JavaTM programming language.) + * JavaTM + * programming language.) * * @param obj the Object that is to be converted into an identity string. * @return the identity string as also defined in Object.toString() Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataId.java Wed Sep 7 21:20:34 2011 @@ -22,7 +22,6 @@ import java.io.Serializable; * The StructuredData identifier. */ public class StructuredDataId implements Serializable { - private static final long serialVersionUID = 9031746276396249990L; /** * RFC 5424 Time Quality. @@ -45,11 +44,14 @@ public class StructuredDataId implements */ public static final int RESERVED = -1; + private static final long serialVersionUID = 9031746276396249990L; + private static final int MAX_LENGTH = 32; + private final String name; private final int enterpriseNumber; private final String[] required; private final String[] optional; - private static final int MAX_LENGTH = 32; + protected StructuredDataId(String name, String[] required, String[] optional) { int index = -1; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/StructuredDataMessage.java Wed Sep 7 21:20:34 2011 @@ -27,13 +27,15 @@ import java.util.TreeMap; * Represents a Message that conforms to RFC 5424 (http://tools.ietf.org/html/rfc5424). */ public class StructuredDataMessage implements FormattedMessage, Serializable { - private static final long serialVersionUID = 1703221292892071920L; - /** * Full message format includes the type and message. */ public static final String FULL = "full"; + private static final long serialVersionUID = 1703221292892071920L; + private static final int MAX_LENGTH = 32; + private static final int HASHVAL = 31; + private Map data = new HashMap(); private StructuredDataId id; @@ -44,9 +46,6 @@ public class StructuredDataMessage imple private String format = null; - private static final int MAX_LENGTH = 32; - private static final int HASHVAL = 31; - /** * Constructor based on a String id. * @param id The String id. Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/message/package-info.java Wed Sep 7 21:20:34 2011 @@ -1,2 +1,21 @@ -/** Public Message Types used for Log4j 2.0. User's may implement their own Messages. */ -package org.apache.logging.log4j.message; \ No newline at end of file +/* + * 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. + */ + +/** + * Public Message Types used for Log4j 2.0. User's may implement their own Messages. + */ +package org.apache.logging.log4j.message; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/package-info.java Wed Sep 7 21:20:34 2011 @@ -1,2 +1,20 @@ -/** Public API for Log4j 2.0. */ -package org.apache.logging.log4j; \ No newline at end of file +/* + * 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. + */ +/** + * Public API for Log4j 2.0. + */ +package org.apache.logging.log4j; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java Wed Sep 7 21:20:34 2011 @@ -33,13 +33,30 @@ import org.apache.logging.log4j.message. */ public abstract class AbstractLogger implements Logger { - static Marker FLOW_MARKER = MarkerManager.getMarker("FLOW"); - static Marker ENTRY_MARKER = MarkerManager.getMarker("ENTRY", FLOW_MARKER); - static Marker EXIT_MARKER = MarkerManager.getMarker("EXIT", FLOW_MARKER); - - static Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION"); - static Marker THROWING_MARKER = MarkerManager.getMarker("THROWING", EXCEPTION_MARKER); - static Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING", EXCEPTION_MARKER); + /** + * Marker for flow tracing. + */ + public static final Marker FLOW_MARKER = MarkerManager.getMarker("FLOW"); + /** + * Marker for method entry tracing. + */ + public static final Marker ENTRY_MARKER = MarkerManager.getMarker("ENTRY", FLOW_MARKER); + /** + * Marker for method exit tracing. + */ + public static final Marker EXIT_MARKER = MarkerManager.getMarker("EXIT", FLOW_MARKER); + /** + * Marker for exception tracing. + */ + public static final Marker EXCEPTION_MARKER = MarkerManager.getMarker("EXCEPTION"); + /** + * Marker for throwing exceptions. + */ + public static final Marker THROWING_MARKER = MarkerManager.getMarker("THROWING", EXCEPTION_MARKER); + /** + * Marker for catching exceptions. + */ + public static final Marker CATCHING_MARKER = MarkerManager.getMarker("CATCHING", EXCEPTION_MARKER); protected String getFQCN() { return AbstractLogger.class.getName(); @@ -50,7 +67,7 @@ public abstract class AbstractLogger imp * Log entry to a method. */ public void entry() { - if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object)null, null)) { + if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) { log(ENTRY_MARKER, getFQCN(), Level.TRACE, new SimpleMessage(" entry"), null); } } @@ -62,7 +79,7 @@ public abstract class AbstractLogger imp * @param params The parameters to the method. */ public void entry(Object... params) { - if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object)null, null)) { + if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) { log(ENTRY_MARKER, getFQCN(), Level.TRACE, entryMsg(params.length, params), null); } } @@ -71,7 +88,7 @@ public abstract class AbstractLogger imp * Log exit from a method. */ public void exit() { - if (isEnabled(Level.TRACE, EXIT_MARKER, (Object)null, null)) { + if (isEnabled(Level.TRACE, EXIT_MARKER, (Object) null, null)) { log(EXIT_MARKER, getFQCN(), Level.TRACE, exitMsg(null), null); } } @@ -82,7 +99,7 @@ public abstract class AbstractLogger imp * @param result The result being returned from the method call. */ public void exit(Object result) { - if (isEnabled(Level.TRACE, EXIT_MARKER, (Object)null, null)) { + if (isEnabled(Level.TRACE, EXIT_MARKER, (Object) null, null)) { log(EXIT_MARKER, getFQCN(), Level.TRACE, exitMsg(result), null); } } @@ -93,7 +110,7 @@ public abstract class AbstractLogger imp * @param t The Throwable. */ public void throwing(Throwable t) { - if (isEnabled(Level.ERROR, THROWING_MARKER, (Object)null, null)) { + if (isEnabled(Level.ERROR, THROWING_MARKER, (Object) null, null)) { log(THROWING_MARKER, getFQCN(), Level.ERROR, new SimpleMessage("throwing"), t); } } @@ -106,7 +123,7 @@ public abstract class AbstractLogger imp * @param t The Throwable. */ public void throwing(Level level, Throwable t) { - if (isEnabled(level, THROWING_MARKER, (Object)null, null)) { + if (isEnabled(level, THROWING_MARKER, (Object) null, null)) { log(THROWING_MARKER, getFQCN(), level, new SimpleMessage("throwing"), t); } } @@ -117,7 +134,7 @@ public abstract class AbstractLogger imp * @param t The Throwable. */ public void catching(Throwable t) { - if (isEnabled(Level.DEBUG, THROWING_MARKER, (Object)null, null)) { + if (isEnabled(Level.DEBUG, THROWING_MARKER, (Object) null, null)) { log(THROWING_MARKER, getFQCN(), Level.DEBUG, new SimpleMessage("catching"), t); } } @@ -129,7 +146,7 @@ public abstract class AbstractLogger imp * @param t The Throwable. */ public void catching(Level level, Throwable t) { - if (isEnabled(level, THROWING_MARKER, (Object)null, null)) { + if (isEnabled(level, THROWING_MARKER, (Object) null, null)) { log(THROWING_MARKER, getFQCN(), level, new SimpleMessage("catching"), t); } } @@ -283,17 +300,18 @@ public abstract class AbstractLogger imp * TRACE, false otherwise. */ public boolean isTraceEnabled() { - return isEnabled(Level.TRACE, null, (Object)null, null); + return isEnabled(Level.TRACE, null, (Object) null, null); } /** * Check whether this Logger is enabled for the TRACE Level. * + * @param marker The marker data. * @return boolean - true if this Logger is enabled for level * TRACE, false otherwise. */ public boolean isTraceEnabled(Marker marker) { - return isEnabled(Level.TRACE, marker, (Object)null, null); + return isEnabled(Level.TRACE, marker, (Object) null, null); } /** @@ -481,11 +499,12 @@ public abstract class AbstractLogger imp /** * Check whether this Logger is enabled for the DEBUG Level. * + * @param marker The marker data. * @return boolean - true if this Logger is enabled for level * DEBUG, false otherwise. */ public boolean isDebugEnabled(Marker marker) { - return isEnabled(Level.DEBUG, marker, (Object)null, null); + return isEnabled(Level.DEBUG, marker, (Object) null, null); } /** @@ -669,12 +688,12 @@ public abstract class AbstractLogger imp * INFO, false otherwise. */ public boolean isInfoEnabled() { - return isEnabled(Level.INFO, null, (Object)null, null); + return isEnabled(Level.INFO, null, (Object) null, null); } /** * Check whether this Logger is enabled for the INFO Level. - * + * @param marker The marker data. * @return boolean - true if this Logger is enabled for level * INFO, false otherwise. */ @@ -862,17 +881,18 @@ public abstract class AbstractLogger imp * WARN, false otherwise. */ public boolean isWarnEnabled() { - return isEnabled(Level.WARN, null, (Object)null, null); + return isEnabled(Level.WARN, null, (Object) null, null); } /** * Check whether this Logger is enabled for the WARN Level. * + * @param marker The marker data. * @return boolean - true if this Logger is enabled for level * WARN, false otherwise. */ public boolean isWarnEnabled(Marker marker) { - return isEnabled(Level.WARN, marker, (Object)null, null); + return isEnabled(Level.WARN, marker, (Object) null, null); } /** @@ -1056,17 +1076,18 @@ public abstract class AbstractLogger imp * ERROR, false otherwise. */ public boolean isErrorEnabled() { - return isEnabled(Level.ERROR, null, (Object)null, null); + return isEnabled(Level.ERROR, null, (Object) null, null); } /** * Check whether this Logger is enabled for the ERROR Level. * + * @param marker The marker data. * @return boolean - true if this Logger is enabled for level * ERROR, false otherwise. */ public boolean isErrorEnabled(Marker marker) { - return isEnabled(Level.ERROR, marker, (Object)null, null); + return isEnabled(Level.ERROR, marker, (Object) null, null); } /** @@ -1250,17 +1271,18 @@ public abstract class AbstractLogger imp * FATAL, false otherwise. */ public boolean isFatalEnabled() { - return isEnabled(Level.ERROR, null, (Object)null, null); + return isEnabled(Level.ERROR, null, (Object) null, null); } /** * Check whether this Logger is enabled for the FATAL Level. * + * @param marker The marker data. * @return boolean - true if this Logger is enabled for level * FATAL, false otherwise. */ public boolean isFatalEnabled(Marker marker) { - return isEnabled(Level.FATAL, marker, (Object)null, null); + return isEnabled(Level.FATAL, marker, (Object) null, null); } /** Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerWrapper.java Wed Sep 7 21:20:34 2011 @@ -25,7 +25,13 @@ import org.apache.logging.log4j.message. */ public class AbstractLoggerWrapper extends AbstractLogger { + /** + * The wrapped Logger. + */ protected final AbstractLogger logger; + /** + * The name of the Logger. + */ protected final String name; /** Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerContextFactory.java Wed Sep 7 21:20:34 2011 @@ -22,10 +22,10 @@ package org.apache.logging.log4j.spi; public interface LoggerContextFactory { /** - * @param FQCN The fully qualified class name of the caller. + * @param fqcn The fully qualified class name of the caller. * @param currentContext If true returns the current Context, if false returns the Context appropriate * for the caller if a more appropriate Context can be determined. * @return The LoggerContext. */ - LoggerContext getContext(String FQCN, boolean currentContext); + LoggerContext getContext(String fqcn, boolean currentContext); } Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerFactory.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerFactory.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerFactory.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/LoggerFactory.java Wed Sep 7 21:20:34 2011 @@ -20,6 +20,7 @@ import org.apache.logging.log4j.Logger; /** * Interface implemented by factories that create Logger objects. + * @param The LoogerContext class. */ public interface LoggerFactory { Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/spi/package-info.java Wed Sep 7 21:20:34 2011 @@ -1,2 +1,20 @@ -/** Internal interfaces and classes to be used by authors of logging implementations. */ -package org.apache.logging.log4j.spi; \ No newline at end of file +/* + * 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. + */ +/** + * Internal interfaces and classes to be used by authors of logging implementations. + */ +package org.apache.logging.log4j.spi; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java Wed Sep 7 21:20:34 2011 @@ -19,7 +19,7 @@ package org.apache.logging.log4j.status; import org.apache.logging.log4j.Level; /** - * StatusListener that writes to the Console + * StatusListener that writes to the Console. */ public class StatusConsoleListener implements StatusListener { Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusData.java Wed Sep 7 21:20:34 2011 @@ -108,7 +108,7 @@ public class StatusData { sb.append(msg.getFormattedMessage()); Object[] params = msg.getParameters(); Throwable t; - if (throwable == null && params != null && params[params.length -1] instanceof Throwable ) { + if (throwable == null && params != null && params[params.length - 1] instanceof Throwable) { t = (Throwable) params[params.length - 1]; } else { t = throwable; Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusListener.java Wed Sep 7 21:20:34 2011 @@ -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.status; /** Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java Wed Sep 7 21:20:34 2011 @@ -34,9 +34,7 @@ import java.util.concurrent.locks.Reentr /** * Mechanism to record events that occur in the logging system. */ -public class StatusLogger extends AbstractLogger { - - private static final String NOT_AVAIL = "?"; +public final class StatusLogger extends AbstractLogger { /** * System property that can be configured with the number of entries in the queue. Once the limit @@ -44,7 +42,9 @@ public class StatusLogger extends Abstra */ public static final String MAX_STATUS_ENTRIES = "log4j2.status.entries"; - private static final int maxEntries = Integer.getInteger(MAX_STATUS_ENTRIES, 200); + private static final String NOT_AVAIL = "?"; + + private static final int MAX_ENTRIES = Integer.getInteger(MAX_STATUS_ENTRIES, 200); // private static final String FQCN = AbstractLogger.class.getName(); @@ -55,7 +55,7 @@ public class StatusLogger extends Abstra private CopyOnWriteArrayList listeners = new CopyOnWriteArrayList(); private ReentrantReadWriteLock listenersLock = new ReentrantReadWriteLock(); - private Queue messages = new BoundedQueue(maxEntries); + private Queue messages = new BoundedQueue(MAX_ENTRIES); private ReentrantLock msgLock = new ReentrantLock(); private StatusLogger() { @@ -244,6 +244,10 @@ public class StatusLogger extends Abstra return false; } + /** + * Queue for status events. + * @param Object type to be stored in the queue. + */ private class BoundedQueue extends ConcurrentLinkedQueue { private final int size; @@ -253,7 +257,7 @@ public class StatusLogger extends Abstra } public boolean add(E object) { - while (messages.size() > maxEntries) { + while (messages.size() > size) { messages.poll(); } return super.add(object); Modified: logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java URL: http://svn.apache.org/viewvc/logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java?rev=1166404&r1=1166403&r2=1166404&view=diff ============================================================================== --- logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java (original) +++ logging/log4j/branches/BRANCH_2_0_EXPERIMENTAL/rgoers/log4j2-api/src/main/java/org/apache/logging/log4j/status/package-info.java Wed Sep 7 21:20:34 2011 @@ -1,4 +1,21 @@ +/* + * 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. + */ + /** Status API for Log4j 2.0. Should not be used by typical applications performing logging but may be * used by applications reporting on the status of the logging system */ -package org.apache.logging.log4j.status; \ No newline at end of file +package org.apache.logging.log4j.status;