LOG4J2-1326 add methods to Logger interface that explicitly accept a CharSequence message
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/348e5221 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/348e5221 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/348e5221 Branch: refs/heads/LOG4J2-1356 Commit: 348e5221ca6fbaef3eb1de30bb07c1e8f8ff722e Parents: ebadc41 Author: rpopma <[email protected]> Authored: Thu Apr 7 22:08:54 2016 +0900 Committer: rpopma <[email protected]> Committed: Thu Apr 7 22:08:54 2016 +0900 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/Logger.java | 244 +++++++++++++++++++ 1 file changed, 244 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/348e5221/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java b/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java index 4043391..1abdf03 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/Logger.java @@ -132,6 +132,24 @@ public interface Logger { void debug(Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#DEBUG DEBUG} level. + * + * @param marker the marker data specific to this log statement + * @param message the message CharSequence to log. + */ + void debug(Marker marker, CharSequence message); + + /** + * Logs a message CharSequence at the {@link Level#DEBUG DEBUG} 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 CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void debug(Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#DEBUG DEBUG} level. * * @param marker the marker data specific to this log statement @@ -251,6 +269,22 @@ public interface Logger { void debug(MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#DEBUG DEBUG} level. + * + * @param message the message object to log. + */ + void debug(CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#DEBUG DEBUG} level including the stack trace of the {@link Throwable} + * <code>t</code> passed as parameter. + * + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void debug(CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#DEBUG DEBUG} level. * * @param message the message object to log. @@ -660,6 +694,24 @@ public interface Logger { void error(Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#ERROR ERROR} level. + * + * @param marker the marker data specific to this log statement. + * @param message the message CharSequence to log. + */ + void error(Marker marker, CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#ERROR ERROR} 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 CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void error(Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#ERROR ERROR} level. * * @param marker the marker data specific to this log statement. @@ -779,6 +831,22 @@ public interface Logger { void error(MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#ERROR ERROR} level. + * + * @param message the message CharSequence to log. + */ + void error(CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#ERROR ERROR} level including the stack trace of the {@link Throwable} + * <code>t</code> passed as parameter. + * + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void error(CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#ERROR ERROR} level. * * @param message the message object to log. @@ -1182,6 +1250,24 @@ public interface Logger { void fatal(Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#FATAL FATAL} level. + * + * @param marker The marker data specific to this log statement. + * @param message the message CharSequence to log. + */ + void fatal(Marker marker, CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#FATAL FATAL} 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 CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void fatal(Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#FATAL FATAL} level. * * @param marker The marker data specific to this log statement. @@ -1301,6 +1387,22 @@ public interface Logger { void fatal(MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#FATAL FATAL} level. + * + * @param message the message CharSequence to log. + */ + void fatal(CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#FATAL FATAL} level including the stack trace of the {@link Throwable} + * <code>t</code> passed as parameter. + * + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void fatal(CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#FATAL FATAL} level. * * @param message the message object to log. @@ -1703,6 +1805,24 @@ public interface Logger { void info(Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#INFO INFO} level. + * + * @param marker the marker data specific to this log statement + * @param message the message CharSequence to log. + */ + void info(Marker marker, CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#INFO INFO} 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 CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void info(Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#INFO INFO} level. * * @param marker the marker data specific to this log statement @@ -1822,6 +1942,22 @@ public interface Logger { void info(MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#INFO INFO} level. + * + * @param message the message CharSequence to log. + */ + void info(CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#INFO INFO} level including the stack trace of the {@link Throwable} + * <code>t</code> passed as parameter. + * + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void info(CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#INFO INFO} level. * * @param message the message object to log. @@ -2324,6 +2460,26 @@ public interface Logger { void log(Level level, Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the given level. + * + * @param level the logging level + * @param marker the marker data specific to this log statement + * @param message the message CharSequence to log. + */ + void log(Level level, Marker marker, CharSequence message); + + /** + * Logs a CharSequence at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as + * parameter. + * + * @param level the logging level + * @param marker the marker data specific to this log statement + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void log(Level level, Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the given level. * * @param level the logging level @@ -2453,6 +2609,24 @@ public interface Logger { void log(Level level, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the given level. + * + * @param level the logging level + * @param message the message CharSequence to log. + */ + void log(Level level, CharSequence message); + + /** + * Logs a CharSequence at the given level including the stack trace of the {@link Throwable} <code>t</code> passed as + * parameter. + * + * @param level the logging level + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void log(Level level, CharSequence message, Throwable t); + + /** * Logs a message object with the given level. * * @param level the logging level @@ -2887,6 +3061,25 @@ public interface Logger { void trace(Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#TRACE TRACE} level. + * + * @param marker the marker data specific to this log statement + * @param message the message CharSequence to log. + */ + void trace(Marker marker, CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#TRACE TRACE} 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 CharSequence to log. + * @param t the exception to log, including its stack trace. + * @see #debug(String) + */ + void trace(Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#TRACE TRACE} level. * * @param marker the marker data specific to this log statement @@ -3008,6 +3201,23 @@ public interface Logger { void trace(MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#TRACE TRACE} level. + * + * @param message the message CharSequence to log. + */ + void trace(CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#TRACE TRACE} level including the stack trace of the {@link Throwable} + * <code>t</code> passed as parameter. + * + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + * @see #debug(String) + */ + void trace(CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#TRACE TRACE} level. * * @param message the message object to log. @@ -3568,6 +3778,24 @@ public interface Logger { void warn(Marker marker, MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#WARN WARN} level. + * + * @param marker the marker data specific to this log statement + * @param message the message CharSequence to log. + */ + void warn(Marker marker, CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#WARN WARN} 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 CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void warn(Marker marker, CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#WARN WARN} level. * * @param marker the marker data specific to this log statement @@ -3687,6 +3915,22 @@ public interface Logger { void warn(MessageSupplier msgSupplier, Throwable t); /** + * Logs a message CharSequence with the {@link Level#WARN WARN} level. + * + * @param message the message CharSequence to log. + */ + void warn(CharSequence message); + + /** + * Logs a CharSequence at the {@link Level#WARN WARN} level including the stack trace of the {@link Throwable} + * <code>t</code> passed as parameter. + * + * @param message the message CharSequence to log. + * @param t the exception to log, including its stack trace. + */ + void warn(CharSequence message, Throwable t); + + /** * Logs a message object with the {@link Level#WARN WARN} level. * * @param message the message object to log.
