You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2014/01/23 08:25:08 UTC
svn commit: r1560602 [1/2] - in /logging/log4j/log4j2/trunk:
log4j-api/src/main/java/org/apache/logging/log4j/
log4j-api/src/main/java/org/apache/logging/log4j/spi/
log4j-api/src/main/java/org/apache/logging/log4j/status/
log4j-api/src/test/java/org/ap...
Author: ggregory
Date: Thu Jan 23 07:25:07 2014
New Revision: 1560602
URL: http://svn.apache.org/r1560602
Log:
[LOG4J2-508] Add new Levels: NOTICE, DIAG, VERBOSE. Fill in methods.
Added:
logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java (with props)
logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java (with props)
logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java (with props)
logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java (with props)
logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java (with props)
logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java (with props)
Modified:
logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Severity.java
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java
logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/TagUtilsTest.java
logging/log4j/log4j2/trunk/log4j-to-slf4j/src/main/java/org/apache/logging/slf4j/SLF4JLogger.java
Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Level.java Thu Jan 23 07:25:07 2014
@@ -46,7 +46,7 @@ public enum Level {
OFF(0),
/**
- * A severe error that will prevent the application from continuing.
+ * A severe error will prevent the application from continuing.
*/
FATAL(100),
@@ -71,12 +71,12 @@ public enum Level {
INFO(500),
/**
- * An event used by operations or users to diagnose problems in the system.
+ * A user or operator debugging event, used to diagnose problems in the system.
*/
DIAG(600),
/**
- * A general debugging event, used by developers for internal debugging.
+ * A developer debugging event, used for internal debugging.
*/
DEBUG(700),
Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java Thu Jan 23 07:25:07 2014
@@ -28,6 +28,7 @@ import org.apache.logging.log4j.spi.Logg
*/
public interface Logger {
+
/**
* Logs an exception or error that has been caught.
*
@@ -43,6 +44,7 @@ public interface Logger {
*/
void catching(Throwable t);
+
/**
* Logs a message with the specific Marker at the {@link Level#DEBUG DEBUG} level.
*
@@ -143,7 +145,7 @@ public interface Logger {
* @param message the message object to log.
*/
void debug(String message);
-
+
/**
* Logs a message with parameters at the {@link Level#DEBUG DEBUG} level.
*
@@ -163,6 +165,125 @@ public interface Logger {
void debug(String message, Throwable t);
/**
+ * Logs a message with the specific Marker at the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ */
+ void diag(Marker marker, Message msg);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ void diag(Marker marker, Message msg, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ */
+ void diag(Marker marker, Object message);
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void diag(Marker marker, Object message, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ */
+ void diag(Marker marker, String message);
+
+ /**
+ * Logs a message with parameters at the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message to log; the format depends on the message factory.
+ * @param params parameters to the message.
+ * @see #getMessageFactory()
+ */
+ void diag(Marker marker, String message, Object... params);
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void diag(Marker marker, String message, Throwable t);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#DIAG DIAG} level.
+ *
+ * @param msg the message string to be logged
+ */
+ void diag(Message msg);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#DIAG DIAG} level.
+ *
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ void diag(Message msg, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param message the message object to log.
+ */
+ void diag(Object message);
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void diag(Object message, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param message the message object to log.
+ */
+ void diag(String message);
+
+ /**
+ * Logs a message with parameters at the {@link Level#DIAG DIAG} level.
+ *
+ * @param message the message to log; the format depends on the message factory.
+ * @param params parameters to the message.
+ * @see #getMessageFactory()
+ */
+ void diag(String message, Object... params);
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void diag(String message, Throwable t);
+
+ /**
* Logs entry to a method.
*/
void entry();
@@ -625,6 +746,21 @@ public interface Logger {
boolean isDebugEnabled(Marker marker);
/**
+ * Checks whether this Logger is enabled for the {@link Level#DIAG DIAG} Level.
+ *
+ * @return boolean - {@code true} if this Logger is enabled for level DIAG, {@code false} otherwise.
+ */
+ boolean isDiagEnabled();
+
+ /**
+ * Checks whether this Logger is enabled for the {@link Level#DIAG DIAG} Level.
+ *
+ * @param marker The marker data specific to this log statement.
+ * @return boolean - {@code true} if this Logger is enabled for level DIAG, {@code false} otherwise.
+ */
+ boolean isDiagEnabled(Marker marker);
+
+ /**
* Checks whether this Logger is enabled for the the given Level.
* <p>
* Note that passing in {@link Level#OFF OFF} always returns {@code true}.
@@ -695,6 +831,21 @@ public interface Logger {
boolean isInfoEnabled(Marker marker);
/**
+ * Checks whether this Logger is enabled for the {@link Level#NOTICE NOTICE} Level.
+ *
+ * @return boolean - {@code true} if this Logger is enabled for level NOTICE, {@code false} otherwise.
+ */
+ boolean isNoticeEnabled();
+
+ /**
+ * Checks whether this Logger is enabled for the {@link Level#NOTICE NOTICE} Level.
+ *
+ * @param marker The marker data specific to this log statement.
+ * @return boolean - {@code true} if this Logger is enabled for level NOTICE, {@code false} otherwise.
+ */
+ boolean isNoticeEnabled(Marker marker);
+
+ /**
* Checks whether this Logger is enabled for the {@link Level#TRACE TRACE} level.
*
* @return boolean - {@code true} if this Logger is enabled for level TRACE, {@code false} otherwise.
@@ -709,6 +860,22 @@ public interface Logger {
*/
boolean isTraceEnabled(Marker marker);
+
+ /**
+ * Checks whether this Logger is enabled for the {@link Level#VERBOSE VERBOSE} Level.
+ *
+ * @return boolean - {@code true} if this Logger is enabled for level VERBOSE, {@code false} otherwise.
+ */
+ boolean isVerboseEnabled();
+
+ /**
+ * Checks whether this Logger is enabled for the {@link Level#VERBOSE VERBOSE} Level.
+ *
+ * @param marker The marker data specific to this log statement.
+ * @return boolean - {@code true} if this Logger is enabled for level VERBOSE, {@code false} otherwise.
+ */
+ boolean isVerboseEnabled(Marker marker);
+
/**
* Checks whether this Logger is enabled for the {@link Level#WARN WARN} Level.
*
@@ -820,7 +987,7 @@ public interface Logger {
* @param message the message object to log.
*/
void log(Level level, Object message);
-
+
/**
* Logs a message at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as
* parameter.
@@ -860,6 +1027,133 @@ public interface Logger {
void log(Level level, String message, Throwable t);
/**
+ * Logs a message with the specific Marker at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ */
+ void notice(Marker marker, Message msg);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ void notice(Marker marker, Message msg, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ */
+ void notice(Marker marker, Object message);
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void notice(Marker marker, Object message, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ */
+ void notice(Marker marker, String message);
+
+ /**
+ * Logs a message with parameters at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message to log; the format depends on the message factory.
+ * @param params parameters to the message.
+ * @see #getMessageFactory()
+ *
+ * @doubt Likely to misinterpret existing log4j client code that intended to call notice(Object,Throwable). Incurs
+ * array creation expense on every call. (RG) It isn't possible to be misinterpreted as the previous method
+ * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
+ */
+ void notice(Marker marker, String message, Object... params);
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void notice(Marker marker, String message, Throwable t);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param msg the message string to be logged
+ */
+ void notice(Message msg);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ void notice(Message msg, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param message the message object to log.
+ */
+ void notice(Object message);
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void notice(Object message, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param message the message object to log.
+ */
+ void notice(String message);
+
+ /**
+ * Logs a message with parameters at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param message the message to log; the format depends on the message factory.
+ * @param params parameters to the message.
+ * @see #getMessageFactory()
+ *
+ * @doubt Likely to misinterpret existing log4j client code that intended to call notice(Object,Throwable). Incurs
+ * array creation expense on every call. (RG) It isn't possible to be misinterpreted as the previous method
+ * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
+ */
+ void notice(String message, Object... params);
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void notice(String message, Throwable t);
+
+ /**
* Logs a formatted message using the specified format string and arguments.
*
* @param level The logging Level.
@@ -1035,6 +1329,133 @@ public interface Logger {
void trace(String message, Throwable t);
/**
+ * Logs a message with the specific Marker at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ */
+ void verbose(Marker marker, Message msg);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ void verbose(Marker marker, Message msg, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ */
+ void verbose(Marker marker, Object message);
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void verbose(Marker marker, Object message, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ */
+ void verbose(Marker marker, String message);
+
+ /**
+ * Logs a message with parameters at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message to log; the format depends on the message factory.
+ * @param params parameters to the message.
+ * @see #getMessageFactory()
+ *
+ * @doubt Likely to misinterpret existing log4j client code that intended to call verbose(Object,Throwable). Incurs
+ * array creation expense on every call. (RG) It isn't possible to be misinterpreted as the previous method
+ * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
+ */
+ void verbose(Marker marker, String message, Object... params);
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void verbose(Marker marker, String message, Throwable t);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param msg the message string to be logged
+ */
+ void verbose(Message msg);
+
+ /**
+ * Logs a message with the specific Marker at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ void verbose(Message msg, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param message the message object to log.
+ */
+ void verbose(Object message);
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void verbose(Object message, Throwable t);
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param message the message object to log.
+ */
+ void verbose(String message);
+
+ /**
+ * Logs a message with parameters at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param message the message to log; the format depends on the message factory.
+ * @param params parameters to the message.
+ * @see #getMessageFactory()
+ *
+ * @doubt Likely to misinterpret existing log4j client code that intended to call verbose(Object,Throwable). Incurs
+ * array creation expense on every call. (RG) It isn't possible to be misinterpreted as the previous method
+ * is for that signature. Methods should be added to avoid varargs for 1, 2 or 3 parameters.
+ */
+ void verbose(String message, Object... params);
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ void verbose(String message, Throwable t);
+
+ /**
* Logs a message with the specific Marker at the {@link Level#WARN WARN} level.
*
* @param marker the marker data specific to this log statement
Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java Thu Jan 23 07:25:07 2014
@@ -29,10 +29,11 @@ import org.apache.logging.log4j.status.S
import java.io.Serializable;
/**
- * Base implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
+ * Abstract implementation of a Logger. It is highly recommended that any Logger implementation extend this class.
*/
public abstract class AbstractLogger implements Logger, Serializable {
+
private static final long serialVersionUID = 2L;
/**
@@ -368,6 +369,195 @@ public abstract class AbstractLogger imp
}
/**
+ * Logs a message with the specific Marker at the DIAG level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ */
+ @Override
+ public void diag(final Marker marker, final Message msg) {
+ if (isEnabled(Level.DIAG, marker, msg, null)) {
+ log(marker, FQCN, Level.DIAG, msg, null);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the DIAG level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ @Override
+ public void diag(final Marker marker, final Message msg, final Throwable t) {
+ if (isEnabled(Level.DIAG, marker, msg, t)) {
+ log(marker, FQCN, Level.DIAG, msg, t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ */
+ @Override
+ public void diag(final Marker marker, final Object message) {
+ if (isEnabled(Level.DIAG, marker, message, null)) {
+ log(marker, FQCN, Level.DIAG, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void diag(final Marker marker, final Object message, final Throwable t) {
+ if (isEnabled(Level.DIAG, marker, message, t)) {
+ log(marker, FQCN, Level.DIAG, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ */
+ @Override
+ public void diag(final Marker marker, final String message) {
+ if (isEnabled(Level.DIAG, marker, message)) {
+ log(marker, FQCN, Level.DIAG, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message with parameters at the {@link Level#DIAG DIAG} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message to log.
+ * @param params parameters to the message.
+ */
+ @Override
+ public void diag(final Marker marker, final String message, final Object... params) {
+ if (isEnabled(Level.DIAG, marker, message, params)) {
+ final Message msg = messageFactory.newMessage(message, params);
+ log(marker, FQCN, Level.DIAG, msg, msg.getThrowable());
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void diag(final Marker marker, final String message, final Throwable t) {
+ if (isEnabled(Level.DIAG, marker, message, t)) {
+ log(marker, FQCN, Level.DIAG, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the DIAG level.
+ *
+ * @param msg the message string to be logged
+ */
+ @Override
+ public void diag(final Message msg) {
+ if (isEnabled(Level.DIAG, null, msg, null)) {
+ log(null, FQCN, Level.DIAG, msg, null);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the DIAG level.
+ *
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ @Override
+ public void diag(final Message msg, final Throwable t) {
+ if (isEnabled(Level.DIAG, null, msg, t)) {
+ log(null, FQCN, Level.DIAG, msg, t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param message the message object to log.
+ */
+ @Override
+ public void diag(final Object message) {
+ if (isEnabled(Level.DIAG, null, message, null)) {
+ log(null, FQCN, Level.DIAG, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void diag(final Object message, final Throwable t) {
+ if (isEnabled(Level.DIAG, null, message, t)) {
+ log(null, FQCN, Level.DIAG, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#DIAG DIAG} level.
+ *
+ * @param message the message object to log.
+ */
+ @Override
+ public void diag(final String message) {
+ if (isEnabled(Level.DIAG, null, message)) {
+ log(null, FQCN, Level.DIAG, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message with parameters at the {@link Level#DIAG DIAG} level.
+ *
+ * @param message the message to log.
+ * @param params parameters to the message.
+ */
+ @Override
+ public void diag(final String message, final Object... params) {
+ if (isEnabled(Level.DIAG, null, message, params)) {
+ final Message msg = messageFactory.newMessage(message, params);
+ log(null, FQCN, Level.DIAG, msg, msg.getThrowable());
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#DIAG DIAG} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void diag(final String message, final Throwable t) {
+ if (isEnabled(Level.DIAG, null, message, t)) {
+ log(null, FQCN, Level.DIAG, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
* Logs entry to a method.
*/
@Override
@@ -1061,6 +1251,7 @@ public abstract class AbstractLogger imp
}
}
+
/**
* Checks whether this Logger is enabled for the DEBUG Level.
*
@@ -1083,6 +1274,27 @@ public abstract class AbstractLogger imp
}
/**
+ * Checks whether this Logger is enabled for the DIAG Level.
+ *
+ * @return boolean - {@code true} if this Logger is enabled for level DIAG, {@code false} otherwise.
+ */
+ @Override
+ public boolean isDiagEnabled() {
+ return isEnabled(Level.DIAG, null, null);
+ }
+
+ /**
+ * Checks whether this Logger is enabled for the DIAG Level.
+ *
+ * @param marker The marker data.
+ * @return boolean - {@code true} if this Logger is enabled for level DIAG, {@code false} otherwise.
+ */
+ @Override
+ public boolean isDiagEnabled(final Marker marker) {
+ return isEnabled(Level.DIAG, marker, (Object) null, null);
+ }
+
+ /**
* Checks whether this Logger is enabled for the the given Level.
* <p>
* Note that passing in {@link Level#OFF OFF} always returns {@code true}.
@@ -1221,6 +1433,27 @@ public abstract class AbstractLogger imp
}
/**
+ * Checks whether this Logger is enabled for the NOTICE Level.
+ *
+ * @return boolean - {@code true} if this Logger is enabled for level NOTICE, {@code false} otherwise.
+ */
+ @Override
+ public boolean isNoticeEnabled() {
+ return isEnabled(Level.NOTICE, null, null);
+ }
+
+ /**
+ * Checks whether this Logger is enabled for the NOTICE Level.
+ *
+ * @param marker The marker data.
+ * @return boolean - {@code true} if this Logger is enabled for level NOTICE, {@code false} otherwise.
+ */
+ @Override
+ public boolean isNoticeEnabled(final Marker marker) {
+ return isEnabled(Level.NOTICE, marker, (Object) null, null);
+ }
+
+ /**
* Checks whether this Logger is enabled for the TRACE Level.
*
* @return boolean - {@code true} if this Logger is enabled for level TRACE, {@code false} otherwise.
@@ -1242,6 +1475,27 @@ public abstract class AbstractLogger imp
}
/**
+ * Checks whether this Logger is enabled for the VERBOSE Level.
+ *
+ * @return boolean - {@code true} if this Logger is enabled for level VERBOSE, {@code false} otherwise.
+ */
+ @Override
+ public boolean isVerboseEnabled() {
+ return isEnabled(Level.VERBOSE, null, null);
+ }
+
+ /**
+ * Checks whether this Logger is enabled for the VERBOSE Level.
+ *
+ * @param marker The marker data.
+ * @return boolean - {@code true} if this Logger is enabled for level VERBOSE, {@code false} otherwise.
+ */
+ @Override
+ public boolean isVerboseEnabled(final Marker marker) {
+ return isEnabled(Level.VERBOSE, marker, (Object) null, null);
+ }
+
+ /**
* Checks whether this Logger is enabled for the WARN Level.
*
* @return boolean - {@code true} if this Logger is enabled for level WARN, {@code false} otherwise.
@@ -1477,6 +1731,195 @@ public abstract class AbstractLogger imp
public abstract void log(Marker marker, String fqcn, Level level, Message data, Throwable t);
/**
+ * Logs a message with the specific Marker at the NOTICE level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ */
+ @Override
+ public void notice(final Marker marker, final Message msg) {
+ if (isEnabled(Level.NOTICE, marker, msg, null)) {
+ log(marker, FQCN, Level.NOTICE, msg, null);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the NOTICE level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ @Override
+ public void notice(final Marker marker, final Message msg, final Throwable t) {
+ if (isEnabled(Level.NOTICE, marker, msg, t)) {
+ log(marker, FQCN, Level.NOTICE, msg, t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ */
+ @Override
+ public void notice(final Marker marker, final Object message) {
+ if (isEnabled(Level.NOTICE, marker, message, null)) {
+ log(marker, FQCN, Level.NOTICE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void notice(final Marker marker, final Object message, final Throwable t) {
+ if (isEnabled(Level.NOTICE, marker, message, t)) {
+ log(marker, FQCN, Level.NOTICE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ */
+ @Override
+ public void notice(final Marker marker, final String message) {
+ if (isEnabled(Level.NOTICE, marker, message)) {
+ log(marker, FQCN, Level.NOTICE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message with parameters at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message to log.
+ * @param params parameters to the message.
+ */
+ @Override
+ public void notice(final Marker marker, final String message, final Object... params) {
+ if (isEnabled(Level.NOTICE, marker, message, params)) {
+ final Message msg = messageFactory.newMessage(message, params);
+ log(marker, FQCN, Level.NOTICE, msg, msg.getThrowable());
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void notice(final Marker marker, final String message, final Throwable t) {
+ if (isEnabled(Level.NOTICE, marker, message, t)) {
+ log(marker, FQCN, Level.NOTICE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the TRACE level.
+ *
+ * @param msg the message string to be logged
+ */
+ @Override
+ public void notice(final Message msg) {
+ if (isEnabled(Level.NOTICE, null, msg, null)) {
+ log(null, FQCN, Level.NOTICE, msg, null);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the NOTICE level.
+ *
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ @Override
+ public void notice(final Message msg, final Throwable t) {
+ if (isEnabled(Level.NOTICE, null, msg, t)) {
+ log(null, FQCN, Level.NOTICE, msg, t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param message the message object to log.
+ */
+ @Override
+ public void notice(final Object message) {
+ if (isEnabled(Level.NOTICE, null, message, null)) {
+ log(null, FQCN, Level.NOTICE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void notice(final Object message, final Throwable t) {
+ if (isEnabled(Level.NOTICE, null, message, t)) {
+ log(null, FQCN, Level.NOTICE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param message the message object to log.
+ */
+ @Override
+ public void notice(final String message) {
+ if (isEnabled(Level.NOTICE, null, message)) {
+ log(null, FQCN, Level.NOTICE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message with parameters at the {@link Level#NOTICE NOTICE} level.
+ *
+ * @param message the message to log.
+ * @param params parameters to the message.
+ */
+ @Override
+ public void notice(final String message, final Object... params) {
+ if (isEnabled(Level.NOTICE, null, message, params)) {
+ final Message msg = messageFactory.newMessage(message, params);
+ log(null, FQCN, Level.NOTICE, msg, msg.getThrowable());
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#NOTICE NOTICE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void notice(final String message, final Throwable t) {
+ if (isEnabled(Level.NOTICE, null, message, t)) {
+ log(null, FQCN, Level.NOTICE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
* Logs a formatted message using the specified format string and arguments.
*
* @param level The logging Level.
@@ -1771,6 +2214,195 @@ public abstract class AbstractLogger imp
}
/**
+ * Logs a message with the specific Marker at the VERBOSE level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ */
+ @Override
+ public void verbose(final Marker marker, final Message msg) {
+ if (isEnabled(Level.VERBOSE, marker, msg, null)) {
+ log(marker, FQCN, Level.VERBOSE, msg, null);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the VERBOSE level.
+ *
+ * @param marker the marker data specific to this log statement
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ @Override
+ public void verbose(final Marker marker, final Message msg, final Throwable t) {
+ if (isEnabled(Level.VERBOSE, marker, msg, t)) {
+ log(marker, FQCN, Level.VERBOSE, msg, t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ */
+ @Override
+ public void verbose(final Marker marker, final Object message) {
+ if (isEnabled(Level.VERBOSE, marker, message, null)) {
+ log(marker, FQCN, Level.VERBOSE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void verbose(final Marker marker, final Object message, final Throwable t) {
+ if (isEnabled(Level.VERBOSE, marker, message, t)) {
+ log(marker, FQCN, Level.VERBOSE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ */
+ @Override
+ public void verbose(final Marker marker, final String message) {
+ if (isEnabled(Level.VERBOSE, marker, message)) {
+ log(marker, FQCN, Level.VERBOSE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message with parameters at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message to log.
+ * @param params parameters to the message.
+ */
+ @Override
+ public void verbose(final Marker marker, final String message, final Object... params) {
+ if (isEnabled(Level.VERBOSE, marker, message, params)) {
+ final Message msg = messageFactory.newMessage(message, params);
+ log(marker, FQCN, Level.VERBOSE, msg, msg.getThrowable());
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param marker the marker data specific to this log statement.
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void verbose(final Marker marker, final String message, final Throwable t) {
+ if (isEnabled(Level.VERBOSE, marker, message, t)) {
+ log(marker, FQCN, Level.VERBOSE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the TRACE level.
+ *
+ * @param msg the message string to be logged
+ */
+ @Override
+ public void verbose(final Message msg) {
+ if (isEnabled(Level.VERBOSE, null, msg, null)) {
+ log(null, FQCN, Level.VERBOSE, msg, null);
+ }
+ }
+
+ /**
+ * Logs a message with the specific Marker at the VERBOSE level.
+ *
+ * @param msg the message string to be logged
+ * @param t A Throwable or null.
+ */
+ @Override
+ public void verbose(final Message msg, final Throwable t) {
+ if (isEnabled(Level.VERBOSE, null, msg, t)) {
+ log(null, FQCN, Level.VERBOSE, msg, t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param message the message object to log.
+ */
+ @Override
+ public void verbose(final Object message) {
+ if (isEnabled(Level.VERBOSE, null, message, null)) {
+ log(null, FQCN, Level.VERBOSE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void verbose(final Object message, final Throwable t) {
+ if (isEnabled(Level.VERBOSE, null, message, t)) {
+ log(null, FQCN, Level.VERBOSE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
+ * Logs a message object with the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param message the message object to log.
+ */
+ @Override
+ public void verbose(final String message) {
+ if (isEnabled(Level.VERBOSE, null, message)) {
+ log(null, FQCN, Level.VERBOSE, messageFactory.newMessage(message), null);
+ }
+ }
+
+ /**
+ * Logs a message with parameters at the {@link Level#VERBOSE VERBOSE} level.
+ *
+ * @param message the message to log.
+ * @param params parameters to the message.
+ */
+ @Override
+ public void verbose(final String message, final Object... params) {
+ if (isEnabled(Level.VERBOSE, null, message, params)) {
+ final Message msg = messageFactory.newMessage(message, params);
+ log(null, FQCN, Level.VERBOSE, msg, msg.getThrowable());
+ }
+ }
+
+ /**
+ * Logs a message at the {@link Level#VERBOSE VERBOSE} level including the stack trace of the {@link Throwable}
+ * <code>t</code> passed as parameter.
+ *
+ * @param message the message object to log.
+ * @param t the exception to log, including its stack trace.
+ */
+ @Override
+ public void verbose(final String message, final Throwable t) {
+ if (isEnabled(Level.VERBOSE, null, message, t)) {
+ log(null, FQCN, Level.VERBOSE, messageFactory.newMessage(message), t);
+ }
+ }
+
+ /**
* Logs a message with the specific Marker at the WARN level.
*
* @param marker the marker data specific to this log statement
Modified: logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java Thu Jan 23 07:25:07 2014
@@ -253,12 +253,18 @@ public final class StatusLogger extends
switch (level) {
case FATAL:
return logger.isFatalEnabled(marker);
+ case VERBOSE:
+ return logger.isVerboseEnabled(marker);
case TRACE:
return logger.isTraceEnabled(marker);
case DEBUG:
return logger.isDebugEnabled(marker);
+ case DIAG:
+ return logger.isDiagEnabled(marker);
case INFO:
return logger.isInfoEnabled(marker);
+ case NOTICE:
+ return logger.isNoticeEnabled(marker);
case WARN:
return logger.isWarnEnabled(marker);
case ERROR:
Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/AbstractLoggerTest.java Thu Jan 23 07:25:07 2014
@@ -52,13 +52,13 @@ public class AbstractLoggerTest extends
private static Throwable t = new UnsupportedOperationException("Test");
private static Class<AbstractLogger> obj = AbstractLogger.class;
+
private static String pattern = "{}, {}";
private static String p1 = "Long Beach";
-
private static String p2 = "California";
+
private static Message simple = new SimpleMessage("Hello");
private static Message object = new ObjectMessage(obj);
-
private static Message param = new ParameterizedMessage(pattern, p1, p2);
private static String marker = "TEST";
@@ -195,6 +195,48 @@ public class AbstractLoggerTest extends
}
@Test
+ public void testDiag() {
+ currentLevel = Level.DIAG;
+
+ currentEvent = events[0];
+ diag("Hello");
+ diag(null, "Hello");
+ currentEvent = events[1];
+ diag(MarkerManager.getMarker("TEST"), "Hello");
+ currentEvent = events[2];
+ diag("Hello", t);
+ diag(null, "Hello", t);
+ currentEvent = events[3];
+ diag(MarkerManager.getMarker("TEST"), "Hello", t);
+ currentEvent = events[4];
+ diag(obj);
+ currentEvent = events[5];
+ diag(MarkerManager.getMarker("TEST"), obj);
+ currentEvent = events[6];
+ diag(obj, t);
+ diag(null, obj, t);
+ currentEvent = events[7];
+ diag(MarkerManager.getMarker("TEST"), obj, t);
+ currentEvent = events[8];
+ diag(pattern, p1, p2);
+ currentEvent = events[9];
+ diag(MarkerManager.getMarker("TEST"), pattern, p1, p2);
+ currentEvent = events[10];
+ diag(simple);
+ diag(null, simple);
+ diag(null, simple, null);
+ currentEvent = events[11];
+ diag(simple, t);
+ diag(null, simple, t);
+ currentEvent = events[12];
+ diag(MarkerManager.getMarker("TEST"), simple, null);
+ currentEvent = events[13];
+ diag(MarkerManager.getMarker("TEST"), simple, t);
+ currentEvent = events[14];
+ diag(MarkerManager.getMarker("TEST"), simple);
+ }
+
+ @Test
public void testDebug() {
currentLevel = Level.DEBUG;
@@ -363,6 +405,48 @@ public class AbstractLoggerTest extends
}
@Test
+ public void testLogDiag() {
+ currentLevel = Level.DIAG;
+
+ currentEvent = events[0];
+ log(Level.DIAG, "Hello");
+ log(Level.DIAG, null, "Hello");
+ currentEvent = events[1];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), "Hello");
+ currentEvent = events[2];
+ log(Level.DIAG, "Hello", t);
+ log(Level.DIAG, null, "Hello", t);
+ currentEvent = events[3];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), "Hello", t);
+ currentEvent = events[4];
+ log(Level.DIAG, obj);
+ currentEvent = events[5];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), obj);
+ currentEvent = events[6];
+ log(Level.DIAG, obj, t);
+ log(Level.DIAG, null, obj, t);
+ currentEvent = events[7];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), obj, t);
+ currentEvent = events[8];
+ log(Level.DIAG, pattern, p1, p2);
+ currentEvent = events[9];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), pattern, p1, p2);
+ currentEvent = events[10];
+ log(Level.DIAG, simple);
+ log(Level.DIAG, null, simple);
+ log(Level.DIAG, null, simple, null);
+ currentEvent = events[11];
+ log(Level.DIAG, simple, t);
+ log(Level.DIAG, null, simple, t);
+ currentEvent = events[12];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), simple, null);
+ currentEvent = events[13];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), simple, t);
+ currentEvent = events[14];
+ log(Level.DIAG, MarkerManager.getMarker("TEST"), simple);
+ }
+
+ @Test
public void testLogDebug() {
currentLevel = Level.DEBUG;
@@ -531,6 +615,48 @@ public class AbstractLoggerTest extends
}
@Test
+ public void testLogNotice() {
+ currentLevel = Level.NOTICE;
+
+ currentEvent = events[0];
+ log(Level.NOTICE, "Hello");
+ log(Level.NOTICE, null, "Hello");
+ currentEvent = events[1];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), "Hello");
+ currentEvent = events[2];
+ log(Level.NOTICE, "Hello", t);
+ log(Level.NOTICE, null, "Hello", t);
+ currentEvent = events[3];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), "Hello", t);
+ currentEvent = events[4];
+ log(Level.NOTICE, obj);
+ currentEvent = events[5];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), obj);
+ currentEvent = events[6];
+ log(Level.NOTICE, obj, t);
+ log(Level.NOTICE, null, obj, t);
+ currentEvent = events[7];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), obj, t);
+ currentEvent = events[8];
+ log(Level.NOTICE, pattern, p1, p2);
+ currentEvent = events[9];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), pattern, p1, p2);
+ currentEvent = events[10];
+ log(Level.NOTICE, simple);
+ log(Level.NOTICE, null, simple);
+ log(Level.NOTICE, null, simple, null);
+ currentEvent = events[11];
+ log(Level.NOTICE, simple, t);
+ log(Level.NOTICE, null, simple, t);
+ currentEvent = events[12];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), simple, null);
+ currentEvent = events[13];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), simple, t);
+ currentEvent = events[14];
+ log(Level.NOTICE, MarkerManager.getMarker("TEST"), simple);
+ }
+
+ @Test
public void testLogTrace() {
currentLevel = Level.TRACE;
@@ -573,6 +699,48 @@ public class AbstractLoggerTest extends
}
@Test
+ public void testLogVerbose() {
+ currentLevel = Level.VERBOSE;
+
+ currentEvent = events[0];
+ log(Level.VERBOSE, "Hello");
+ log(Level.VERBOSE, null, "Hello");
+ currentEvent = events[1];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), "Hello");
+ currentEvent = events[2];
+ log(Level.VERBOSE, "Hello", t);
+ log(Level.VERBOSE, null, "Hello", t);
+ currentEvent = events[3];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), "Hello", t);
+ currentEvent = events[4];
+ log(Level.VERBOSE, obj);
+ currentEvent = events[5];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), obj);
+ currentEvent = events[6];
+ log(Level.VERBOSE, obj, t);
+ log(Level.VERBOSE, null, obj, t);
+ currentEvent = events[7];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), obj, t);
+ currentEvent = events[8];
+ log(Level.VERBOSE, pattern, p1, p2);
+ currentEvent = events[9];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), pattern, p1, p2);
+ currentEvent = events[10];
+ log(Level.VERBOSE, simple);
+ log(Level.VERBOSE, null, simple);
+ log(Level.VERBOSE, null, simple, null);
+ currentEvent = events[11];
+ log(Level.VERBOSE, simple, t);
+ log(Level.VERBOSE, null, simple, t);
+ currentEvent = events[12];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), simple, null);
+ currentEvent = events[13];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), simple, t);
+ currentEvent = events[14];
+ log(Level.VERBOSE, MarkerManager.getMarker("TEST"), simple);
+ }
+
+ @Test
public void testLogWarn() {
currentLevel = Level.WARN;
@@ -615,6 +783,48 @@ public class AbstractLoggerTest extends
}
@Test
+ public void testNotice() {
+ currentLevel = Level.NOTICE;
+
+ currentEvent = events[0];
+ notice("Hello");
+ notice(null, "Hello");
+ currentEvent = events[1];
+ notice(MarkerManager.getMarker("TEST"), "Hello");
+ currentEvent = events[2];
+ notice("Hello", t);
+ notice(null, "Hello", t);
+ currentEvent = events[3];
+ notice(MarkerManager.getMarker("TEST"), "Hello", t);
+ currentEvent = events[4];
+ notice(obj);
+ currentEvent = events[5];
+ notice(MarkerManager.getMarker("TEST"), obj);
+ currentEvent = events[6];
+ notice(obj, t);
+ notice(null, obj, t);
+ currentEvent = events[7];
+ notice(MarkerManager.getMarker("TEST"), obj, t);
+ currentEvent = events[8];
+ notice(pattern, p1, p2);
+ currentEvent = events[9];
+ notice(MarkerManager.getMarker("TEST"), pattern, p1, p2);
+ currentEvent = events[10];
+ notice(simple);
+ notice(null, simple);
+ notice(null, simple, null);
+ currentEvent = events[11];
+ notice(simple, t);
+ notice(null, simple, t);
+ currentEvent = events[12];
+ notice(MarkerManager.getMarker("TEST"), simple, null);
+ currentEvent = events[13];
+ notice(MarkerManager.getMarker("TEST"), simple, t);
+ currentEvent = events[14];
+ notice(MarkerManager.getMarker("TEST"), simple);
+ }
+
+ @Test
public void testTrace() {
currentLevel = Level.TRACE;
@@ -657,6 +867,48 @@ public class AbstractLoggerTest extends
}
@Test
+ public void testVerbose() {
+ currentLevel = Level.VERBOSE;
+
+ currentEvent = events[0];
+ verbose("Hello");
+ verbose(null, "Hello");
+ currentEvent = events[1];
+ verbose(MarkerManager.getMarker("TEST"), "Hello");
+ currentEvent = events[2];
+ verbose("Hello", t);
+ verbose(null, "Hello", t);
+ currentEvent = events[3];
+ verbose(MarkerManager.getMarker("TEST"), "Hello", t);
+ currentEvent = events[4];
+ verbose(obj);
+ currentEvent = events[5];
+ verbose(MarkerManager.getMarker("TEST"), obj);
+ currentEvent = events[6];
+ verbose(obj, t);
+ verbose(null, obj, t);
+ currentEvent = events[7];
+ verbose(MarkerManager.getMarker("TEST"), obj, t);
+ currentEvent = events[8];
+ verbose(pattern, p1, p2);
+ currentEvent = events[9];
+ verbose(MarkerManager.getMarker("TEST"), pattern, p1, p2);
+ currentEvent = events[10];
+ verbose(simple);
+ verbose(null, simple);
+ verbose(null, simple, null);
+ currentEvent = events[11];
+ verbose(simple, t);
+ verbose(null, simple, t);
+ currentEvent = events[12];
+ verbose(MarkerManager.getMarker("TEST"), simple, null);
+ currentEvent = events[13];
+ verbose(MarkerManager.getMarker("TEST"), simple, t);
+ currentEvent = events[14];
+ verbose(MarkerManager.getMarker("TEST"), simple);
+ }
+
+ @Test
public void testWarn() {
currentLevel = Level.WARN;
Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LevelTest.java Thu Jan 23 07:25:07 2014
@@ -27,16 +27,80 @@ import static org.junit.Assert.assertNot
public class LevelTest {
@Test
- public void testGoodLevels() {
+ public void testDefault() {
+ final Level level = Level.toLevel("Information", Level.ERROR);
+ assertNotNull(level);
+ assertEquals(Level.ERROR, level);
+ }
+
+ @Test
+ public void testGoodDebugLevel() {
+ final Level level = Level.toLevel("DEBUG");
+ assertNotNull(level);
+ assertEquals(Level.DEBUG, level);
+ }
+
+ @Test
+ public void testGoodDiagLevel() {
+ final Level level = Level.toLevel("DIAG");
+ assertNotNull(level);
+ assertEquals(Level.DIAG, level);
+ }
+
+ @Test
+ public void testGoodErrorLevel() {
+ final Level level = Level.toLevel("ERROR");
+ assertNotNull(level);
+ assertEquals(Level.ERROR, level);
+ }
+
+ @Test
+ public void testGoodFatalLevel() {
+ final Level level = Level.toLevel("FATAL");
+ assertNotNull(level);
+ assertEquals(Level.FATAL, level);
+ }
+
+ @Test
+ public void testGoodInfoLevel() {
final Level level = Level.toLevel("INFO");
assertNotNull(level);
assertEquals(Level.INFO, level);
}
@Test
- public void testDefault() {
- final Level level = Level.toLevel("Information", Level.ERROR);
+ public void testGoodNoticeLevel() {
+ final Level level = Level.toLevel("NOTICE");
assertNotNull(level);
- assertEquals(Level.ERROR, level);
+ assertEquals(Level.NOTICE, level);
+ }
+
+ @Test
+ public void testGoodOffLevel() {
+ final Level level = Level.toLevel("OFF");
+ assertNotNull(level);
+ assertEquals(Level.OFF, level);
+ }
+
+ @Test
+ public void testGoodTraceLevel() {
+ final Level level = Level.toLevel("TRACE");
+ assertNotNull(level);
+ assertEquals(Level.TRACE, level);
+ }
+
+
+ @Test
+ public void testGoodVerboseLevel() {
+ final Level level = Level.toLevel("VERBOSE");
+ assertNotNull(level);
+ assertEquals(Level.VERBOSE, level);
+ }
+
+ @Test
+ public void testGoodWarnLevel() {
+ final Level level = Level.toLevel("WARN");
+ assertNotNull(level);
+ assertEquals(Level.WARN, level);
}
}
Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/LoggerTest.java Thu Jan 23 07:25:07 2014
@@ -306,6 +306,12 @@ public class LoggerTest {
}
@Test
+ public void isDiagEnabled() {
+ assertTrue("Incorrect level", logger.isDiagEnabled());
+ assertTrue("Incorrect level", logger.isEnabled(Level.DIAG));
+ }
+
+ @Test
public void isDebugEnabled() {
assertTrue("Incorrect level", logger.isDebugEnabled());
assertTrue("Incorrect level", logger.isEnabled(Level.DEBUG));
@@ -330,6 +336,12 @@ public class LoggerTest {
}
@Test
+ public void isNoticeEnabled() {
+ assertTrue("Incorrect level", logger.isNoticeEnabled());
+ assertTrue("Incorrect level", logger.isEnabled(Level.NOTICE));
+ }
+
+ @Test
public void isOffEnabled() {
assertTrue("Incorrect level", logger.isEnabled(Level.OFF));
}
@@ -341,6 +353,12 @@ public class LoggerTest {
}
@Test
+ public void isVerboseEnabled() {
+ assertTrue("Incorrect level", logger.isVerboseEnabled());
+ assertTrue("Incorrect level", logger.isEnabled(Level.VERBOSE));
+ }
+
+ @Test
public void isWarnEnabled() {
assertTrue("Incorrect level", logger.isWarnEnabled());
assertTrue("Incorrect level", logger.isEnabled(Level.WARN));
Modified: logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-api/src/test/java/org/apache/logging/log4j/spi/LoggerStreamTest.java Thu Jan 23 07:25:07 2014
@@ -43,8 +43,13 @@ public class LoggerStreamTest {
public static Collection<Object[]> data() {
return Arrays.asList(
new Object[][]{
+ { Level.ALL, "all log string test" },
+ { Level.TRACE, "trace log string test" },
+ { Level.VERBOSE, "verbose log string test" },
{ Level.DEBUG, "debug log string test" },
+ { Level.DIAG, "diag log string test" },
{ Level.INFO, "info log string test" },
+ { Level.NOTICE, "notice log string test" },
{ Level.WARN, "DANGER ZONE" },
{ Level.ERROR, "MAYDAY! MAYDAY!" },
{ Level.FATAL, "ABANDON SHIP!" }
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Severity.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Severity.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Severity.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/net/Severity.java Thu Jan 23 07:25:07 2014
@@ -82,13 +82,15 @@ public enum Severity {
public static Severity getSeverity(final Level level) {
switch (level) {
case ALL:
- return DEBUG;
case TRACE:
- return DEBUG;
+ case VERBOSE:
case DEBUG:
+ case DIAG:
return DEBUG;
case INFO:
return INFO;
+ case NOTICE:
+ return NOTICE;
case WARN:
return WARNING;
case ERROR:
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/HighlightConverter.java Thu Jan 23 07:25:07 2014
@@ -89,15 +89,21 @@ public final class HighlightConverter ex
DEFAULT_STYLES.put(Level.FATAL, AnsiEscape.createSequence("BRIGHT", "RED"));
DEFAULT_STYLES.put(Level.ERROR, AnsiEscape.createSequence("BRIGHT", "RED"));
DEFAULT_STYLES.put(Level.WARN, AnsiEscape.createSequence("YELLOW"));
+ DEFAULT_STYLES.put(Level.NOTICE, AnsiEscape.createSequence("YELLOW"));
DEFAULT_STYLES.put(Level.INFO, AnsiEscape.createSequence("GREEN"));
+ DEFAULT_STYLES.put(Level.DIAG, AnsiEscape.createSequence("CYAN"));
DEFAULT_STYLES.put(Level.DEBUG, AnsiEscape.createSequence("CYAN"));
+ DEFAULT_STYLES.put(Level.VERBOSE, AnsiEscape.createSequence("CYAN"));
DEFAULT_STYLES.put(Level.TRACE, AnsiEscape.createSequence("BLACK"));
// Logback styles:
LOGBACK_STYLES.put(Level.FATAL, AnsiEscape.createSequence("BLINK", "BRIGHT", "RED"));
LOGBACK_STYLES.put(Level.ERROR, AnsiEscape.createSequence("BRIGHT", "RED"));
LOGBACK_STYLES.put(Level.WARN, AnsiEscape.createSequence("RED"));
+ LOGBACK_STYLES.put(Level.NOTICE, AnsiEscape.createSequence("RED"));
LOGBACK_STYLES.put(Level.INFO, AnsiEscape.createSequence("BLUE"));
+ LOGBACK_STYLES.put(Level.DIAG, AnsiEscape.createSequence((String[]) null));
LOGBACK_STYLES.put(Level.DEBUG, AnsiEscape.createSequence((String[]) null));
+ LOGBACK_STYLES.put(Level.VERBOSE, AnsiEscape.createSequence((String[]) null));
LOGBACK_STYLES.put(Level.TRACE, AnsiEscape.createSequence((String[]) null));
// Style map:
STYLES.put(STYLE_KEY_DEFAULT, DEFAULT_STYLES);
Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/pattern/LevelPatternConverter.java Thu Jan 23 07:25:07 2014
@@ -134,12 +134,21 @@ public final class LevelPatternConverter
case TRACE:
return "level trace";
+ case VERBOSE:
+ return "level verbose";
+
case DEBUG:
return "level debug";
+ case DIAG:
+ return "level debug";
+
case INFO:
return "level info";
+ case NOTICE:
+ return "level notice";
+
case WARN:
return "level warn";
Modified: logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-core/src/test/java/org/apache/logging/log4j/core/net/PriorityTest.java Thu Jan 23 07:25:07 2014
@@ -16,7 +16,7 @@
*/
package org.apache.logging.log4j.core.net;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertEquals;
import org.apache.logging.log4j.Level;
import org.junit.Test;
@@ -27,8 +27,57 @@ import org.junit.Test;
public class PriorityTest {
@Test
- public void testP1() {
+ public void testAuthDebug() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.DEBUG);
+ assertEquals(39, p);
+ }
+
+ @Test
+ public void testAuthDiag() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.DIAG);
+ assertEquals(39, p);
+ }
+
+ @Test
+ public void testAuthError() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.ERROR);
+ assertEquals(35, p);
+ }
+
+ @Test
+ public void testAuthFatal() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.FATAL);
+ assertEquals(33, p);
+ }
+
+ @Test
+ public void testAuthInfo() {
final int p = Priority.getPriority(Facility.AUTH, Level.INFO);
- assertTrue("Expected priority value is 38, got "+ p, p == 38);
+ assertEquals(38, p);
}
+
+ @Test
+ public void testAuthNotice() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.NOTICE);
+ assertEquals(37, p);
+ }
+
+ @Test
+ public void testAuthTrace() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.TRACE);
+ assertEquals(39, p);
+ }
+
+ @Test
+ public void testAuthVerbose() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.VERBOSE);
+ assertEquals(39, p);
+ }
+
+ @Test
+ public void testAuthWarn() {
+ final int p = Priority.getPriority(Facility.AUTH, Level.WARN);
+ assertEquals(36, p);
+ }
+
}
Added: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java?rev=1560602&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java (added)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java Thu Jan 23 07:25:07 2014
@@ -0,0 +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.taglib;
+
+import org.apache.logging.log4j.Level;
+
+/**
+ * This class implements the {@code <log:debug>} tag.
+ *
+ * @since 2.0
+ */
+public class DiagTag extends LoggingMessageTagSupport {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected Level getLevel() {
+ return Level.DIAG;
+ }
+}
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/DiagTag.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java?rev=1560602&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java (added)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java Thu Jan 23 07:25:07 2014
@@ -0,0 +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.taglib;
+
+import org.apache.logging.log4j.Level;
+
+/**
+ * This class implements the {@code <log:notice>} tag.
+ *
+ * @since 2.0
+ */
+public class NoticeTag extends LoggingMessageTagSupport {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected Level getLevel() {
+ return Level.NOTICE;
+ }
+}
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/NoticeTag.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java?rev=1560602&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java (added)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java Thu Jan 23 07:25:07 2014
@@ -0,0 +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.taglib;
+
+import org.apache.logging.log4j.Level;
+
+/**
+ * This class implements the {@code <log:verbose>} tag.
+ *
+ * @since 2.0
+ */
+public class VerboseTag extends LoggingMessageTagSupport {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected Level getLevel() {
+ return Level.VERBOSE;
+ }
+}
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/main/java/org/apache/logging/log4j/taglib/VerboseTag.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java?rev=1560602&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java (added)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java Thu Jan 23 07:25:07 2014
@@ -0,0 +1,32 @@
+/*
+ * 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.taglib;
+
+import org.apache.logging.log4j.Level;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ *
+ */
+public class DiagTagTest {
+ @Test
+ public void testGetLevel() {
+ assertEquals("The logging level is not correct.", Level.DIAG, new DiagTag().getLevel());
+ }
+}
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/DiagTagTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Added: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java?rev=1560602&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java (added)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java Thu Jan 23 07:25:07 2014
@@ -0,0 +1,32 @@
+/*
+ * 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.taglib;
+
+import org.apache.logging.log4j.Level;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ *
+ */
+public class NoticeTagTest {
+ @Test
+ public void testGetLevel() {
+ assertEquals("The logging level is not correct.", Level.NOTICE, new NoticeTag().getLevel());
+ }
+}
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/NoticeTagTest.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/TagUtilsTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/TagUtilsTest.java?rev=1560602&r1=1560601&r2=1560602&view=diff
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/TagUtilsTest.java (original)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/TagUtilsTest.java Thu Jan 23 07:25:07 2014
@@ -63,6 +63,16 @@ public class TagUtilsTest {
}
@Test
+ public void testResolveLevelDiag01() {
+ assertEquals("The value is not correct.", Level.DIAG, TagUtils.resolveLevel("diag"));
+ }
+
+ @Test
+ public void testResolveLevelDiag02() {
+ assertEquals("The value is not correct.", Level.DIAG, TagUtils.resolveLevel(Level.DIAG));
+ }
+
+ @Test
public void testResolveLevelError01() {
assertEquals("The value is not correct.", Level.ERROR, TagUtils.resolveLevel("error"));
}
@@ -93,6 +103,16 @@ public class TagUtilsTest {
}
@Test
+ public void testResolveLevelNotice01() {
+ assertEquals("The value is not correct.", Level.NOTICE, TagUtils.resolveLevel("notice"));
+ }
+
+ @Test
+ public void testResolveLevelNotice02() {
+ assertEquals("The value is not correct.", Level.NOTICE, TagUtils.resolveLevel(Level.NOTICE));
+ }
+
+ @Test
public void testResolveLevelTrace01() {
assertEquals("The value is not correct.", Level.TRACE, TagUtils.resolveLevel("trace"));
}
@@ -103,6 +123,16 @@ public class TagUtilsTest {
}
@Test
+ public void testResolveLevelVerbose01() {
+ assertEquals("The value is not correct.", Level.VERBOSE, TagUtils.resolveLevel("verbose"));
+ }
+
+ @Test
+ public void testResolveLevelVerbose02() {
+ assertEquals("The value is not correct.", Level.VERBOSE, TagUtils.resolveLevel(Level.VERBOSE));
+ }
+
+ @Test
public void testResolveLevelWarn01() {
assertEquals("The value is not correct.", Level.WARN, TagUtils.resolveLevel("warn"));
}
Added: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java
URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java?rev=1560602&view=auto
==============================================================================
--- logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java (added)
+++ logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java Thu Jan 23 07:25:07 2014
@@ -0,0 +1,32 @@
+/*
+ * 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.taglib;
+
+import org.apache.logging.log4j.Level;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ *
+ */
+public class VerboseTagTest {
+ @Test
+ public void testGetLevel() {
+ assertEquals("The logging level is not correct.", Level.VERBOSE, new VerboseTag().getLevel());
+ }
+}
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4j/log4j2/trunk/log4j-taglib/src/test/java/org/apache/logging/log4j/taglib/VerboseTagTest.java
------------------------------------------------------------------------------
svn:keywords = Id