From 99c9eb8a756df79e94234f00a348b0ee6222098e Mon Sep 17 00:00:00 2001
From: Ceki Gulcu trace, debug(), info(),
* warn(), error() printing methods are directly
* mapped to their SLF4J equivalents. Log4j's fatal() printing
- * method is mapped to SLF4J's error() method with a FATAL
- * marker.
+ * method is mapped to SLF4J's error() method with a FATAL marker.
*
* @author Sébastien Pennec
* @author Ceki Gülcü
@@ -148,7 +147,7 @@ public class Category {
* SLF4J equivalent, except for FATAL which is mapped as ERROR.
*
* @param p
- * the priority to check against
+ * the priority to check against
* @return true if this logger is enabled for the given level, false
* otherwise.
*/
@@ -281,30 +280,22 @@ public class Category {
LocationAwareLogger.ERROR_INT, message, t);
}
-
+ // See also http://bugzilla.slf4j.org/show_bug.cgi?id=168
public void log(String FQCN, Priority p, Object msg, Throwable t) {
int levelInt = priorityToLevelInt(p);
- if (locationAwareLogger != null) {
- locationAwareLogger.log(null, FQCN, levelInt, convertToString(msg), t);
- } else {
- throw new UnsupportedOperationException("The logger [" + slf4jLogger
- + "] does not seem to be location aware.");
- }
+ differentiatedLog(null, FQCN, levelInt, msg, t);
}
public void log(Priority p, Object message, Throwable t) {
int levelInt = priorityToLevelInt(p);
- differentiatedLog(null, CATEGORY_FQCN, levelInt,
- message, t);
+ differentiatedLog(null, CATEGORY_FQCN, levelInt, message, t);
}
public void log(Priority p, Object message) {
int levelInt = priorityToLevelInt(p);
- differentiatedLog(null, CATEGORY_FQCN, levelInt,
- message, null);
+ differentiatedLog(null, CATEGORY_FQCN, levelInt, message, null);
}
-
private int priorityToLevelInt(Priority p) {
switch (p.level) {
case Level.TRACE_INT:
diff --git a/slf4j-site/src/site/pages/index.html b/slf4j-site/src/site/pages/index.html
index 28058853..0aea6bbd 100644
--- a/slf4j-site/src/site/pages/index.html
+++ b/slf4j-site/src/site/pages/index.html
@@ -46,6 +46,110 @@
href="legacy.html">legacy APIs.
Here is a non-exhaustive list of projects known to depend on + SLF4J, in alphabetical order: +
+ +| + + | + +
+
|
+
+ + + | +
+
|
+
+
+
+
|
+
+
+
|
+
Fixed bug
+ 168. In case log4j-over-slf4j is used and a logback appender
+ requires a third party library which depends on log4j, the
+ log(String FQCN, Priority p, Object msg, Throwable t)
+ method in log4j-over-slf4j's Categotry class would throw an
+ UnsupportedOperationException. Problem reported by Seth
+ Call.