[slf4j-dev] svn commit: r736 - slf4j/trunk/slf4j-api/src/main/java/org/slf4j
ceki at slf4j.org
ceki at slf4j.org
Mon Feb 19 22:52:45 CET 2007
Author: ceki
Date: Mon Feb 19 22:52:44 2007
New Revision: 736
Modified:
slf4j/trunk/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java
Log:
Better error reporting.
Modified: slf4j/trunk/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java
==============================================================================
--- slf4j/trunk/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java (original)
+++ slf4j/trunk/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java Mon Feb 19 22:52:44 2007
@@ -79,6 +79,9 @@
* @return logger
*/
public static Logger getLogger(String name) {
+ if(loggerFactory == null) {
+ throw new IllegalStateException("Logging factory cannot be null. See also http://www.slf4j.org/codes.html#null_LF");
+ }
return loggerFactory.getLogger(name);
}
@@ -91,6 +94,9 @@
* @return logger
*/
public static Logger getLogger(Class clazz) {
+ if(loggerFactory == null) {
+ throw new IllegalStateException("Logging factory cannot be null. See also http://www.slf4j.org/codes.html#null_LF");
+ }
return loggerFactory.getLogger(clazz.getName());
}
More information about the slf4j-dev
mailing list