[slf4j-dev] svn commit: r81 - slf4j/trunk/src/filtered-java/org/slf4j
ceki at slf4j.org
ceki at slf4j.org
Fri May 20 18:33:51 CEST 2005
Author: ceki
Date: Fri May 20 18:33:49 2005
New Revision: 81
Modified:
slf4j/trunk/src/filtered-java/org/slf4j/Constants.java
slf4j/trunk/src/filtered-java/org/slf4j/LoggerFactory.java
Log:
minor corrections
Modified: slf4j/trunk/src/filtered-java/org/slf4j/Constants.java
==============================================================================
--- slf4j/trunk/src/filtered-java/org/slf4j/Constants.java (original)
+++ slf4j/trunk/src/filtered-java/org/slf4j/Constants.java Fri May 20 18:33:49 2005
@@ -40,9 +40,9 @@
* The name of the system property to set in order to instruct
* {@link LoggerFactory} class to use a specific factory adapter.
* <p>
- * This constant is currently set to the value "LOGGER_FA_FACTORY".
+ * This constant is currently set to the value "org.slf4j.factory".
*/
- final public static String LOGGER_FA_FACTORY = "LOGGER_FA_FACTORY";
+ final public static String LOGGER_FA_FACTORY_PROPERTY = "org.slf4j.factory";
/**
* Constant used to determined the name of the factory method for
Modified: slf4j/trunk/src/filtered-java/org/slf4j/LoggerFactory.java
==============================================================================
--- slf4j/trunk/src/filtered-java/org/slf4j/LoggerFactory.java (original)
+++ slf4j/trunk/src/filtered-java/org/slf4j/LoggerFactory.java Fri May 20 18:33:49 2005
@@ -66,8 +66,7 @@
try {
adapter = new org.slf4j.impl. at IMPL@LoggerFA();
} catch (Exception e) {
- // unless there was a problem with the build or the JVM we will never
- // get exceptions
+ // we should never get here
reportFailure(
"Could not instantiate instance of class [" + adapterClassStr + "]",
e);
@@ -85,7 +84,7 @@
String faFactoryClassName = null;
try {
- faFactoryClassName = System.getProperty(Constants.LOGGER_FA_FACTORY);
+ faFactoryClassName = System.getProperty(Constants.LOGGER_FA_FACTORY_PROPERTY);
if (faFactoryClassName == null) {
return null;
}
@@ -101,11 +100,11 @@
} catch (Throwable t) {
if (faFactoryClassName == null) {
reportFailure(
- "Failed to fetch " + Constants.LOGGER_FA_FACTORY
+ "Failed to fetch " + Constants.LOGGER_FA_FACTORY_PROPERTY
+ " system property.", t);
} else {
reportFailure(
- "Failed to fectch LoggerFactoryAdapter using the "
+ "Failed to fetch LoggerFactoryAdapter using the "
+ faFactoryClassName + " class.", t);
}
}
@@ -115,11 +114,17 @@
}
static void reportFailure(String msg, Throwable t) {
- System.out.println(msg);
- System.out.println("Reported exception follows.");
- t.printStackTrace(System.out);
+ System.err.println(msg);
+ System.err.println("Reported exception follows.");
+ t.printStackTrace();
}
+ /**
+ * Return a logger named according to the name parameter using the
+ * previously bound {@link LoggerFactoryAdapter adapter}.
+ * @param name The name of the logger.
+ * @return logger
+ */
public static Logger getLogger(String name) {
return adapter.getLogger(name);
}
More information about the slf4j-dev
mailing list