[slf4j-dev] svn commit: r557 - slf4j/trunk/src/java/org/slf4j/impl
ceki at slf4j.org
ceki at slf4j.org
Wed Mar 8 20:58:11 CET 2006
Author: ceki
Date: Wed Mar 8 20:58:10 2006
New Revision: 557
Modified:
slf4j/trunk/src/java/org/slf4j/impl/JDK14LoggerAdapter.java
Log:
- minor bug fix in the info method
- javadoc updates
Modified: slf4j/trunk/src/java/org/slf4j/impl/JDK14LoggerAdapter.java
==============================================================================
--- slf4j/trunk/src/java/org/slf4j/impl/JDK14LoggerAdapter.java (original)
+++ slf4j/trunk/src/java/org/slf4j/impl/JDK14LoggerAdapter.java Wed Mar 8 20:58:10 2006
@@ -173,7 +173,7 @@
* the message object to be logged
*/
public void info(String msg) {
- logger.info(msg);
+ log(Level.INFO, msg, null);
}
/**
@@ -448,6 +448,17 @@
log(Level.SEVERE, msg, t);
}
+
+ /**
+ * Log the message at the specified level with the specified
+ * throwable if any. This method creates a LogRecord and fills
+ * in caller date before calling this instance's JDK14 logger.
+ *
+ * See bug report #13 for more details.
+ * @param level
+ * @param msg
+ * @param t
+ */
private void log(Level level, String msg, Throwable t) {
LogRecord record = new LogRecord(level, msg);
record.setThrown(t);
@@ -459,7 +470,12 @@
static String SELF = JDK14LoggerAdapter.class.getName();
static String SUPER = MarkerIgnoringBase.class.getName();
- private final void fillCallerData(LogRecord record) {
+ /**
+ * Fill in caller data if possible.
+ *
+ * @param record The record to update
+ */
+ final private void fillCallerData(LogRecord record) {
StackTraceElement[] steArray = new Throwable().getStackTrace();
int selfIndex = -1;
More information about the slf4j-dev
mailing list