[slf4j-dev] branch, master, updated. 30b9ee08d389b5f8cce436a92db7ae8ace5fd052
added by portage for gitosis-gentoo
git-noreply at pixie.qos.ch
Fri Sep 4 19:54:58 CEST 2009
The branch, master has been updated
via 30b9ee08d389b5f8cce436a92db7ae8ace5fd052 (commit)
via e69cd9fa619b82eb22a7a78decc34937b4c00870 (commit)
from a9ff32e4b71921a09951dba2e48d14e93421c8a4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=30b9ee08d389b5f8cce436a92db7ae8ace5fd052
http://github.com/ceki/slf4j/commit/30b9ee08d389b5f8cce436a92db7ae8ace5fd052
commit 30b9ee08d389b5f8cce436a92db7ae8ace5fd052
Author: Ceki Gulcu <ceki at qos.ch>
Date: Fri Sep 4 19:52:34 2009 +0200
- Preparing release 1.5.9-RC0
diff --git a/integration/pom.xml b/integration/pom.xml
index 03f0af9..ecbf85d 100644
--- a/integration/pom.xml
+++ b/integration/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jcl-over-slf4j/pom.xml b/jcl-over-slf4j/pom.xml
index 12bea5c..884d25a 100644
--- a/jcl-over-slf4j/pom.xml
+++ b/jcl-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jcl104-over-slf4j/pom.xml b/jcl104-over-slf4j/pom.xml
index 05deb51..c63e906 100644
--- a/jcl104-over-slf4j/pom.xml
+++ b/jcl104-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/jul-to-slf4j/pom.xml b/jul-to-slf4j/pom.xml
index 6957bec..51b36a2 100644
--- a/jul-to-slf4j/pom.xml
+++ b/jul-to-slf4j/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/log4j-over-slf4j/pom.xml b/log4j-over-slf4j/pom.xml
index 201dc46..63b64c0 100644
--- a/log4j-over-slf4j/pom.xml
+++ b/log4j-over-slf4j/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/osgi-over-slf4j/pom.xml b/osgi-over-slf4j/pom.xml
index e764439..35f2ccb 100644
--- a/osgi-over-slf4j/pom.xml
+++ b/osgi-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index 25eb1bf..0287538 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
<packaging>pom</packaging>
<name>SLF4J</name>
diff --git a/slf4j-api/pom.xml b/slf4j-api/pom.xml
index cf1b749..4304c57 100644
--- a/slf4j-api/pom.xml
+++ b/slf4j-api/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 1c54706..bbf2fe5 100644
--- a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -61,7 +61,7 @@ public class StaticLoggerBinder {
* The value of this field is usually modified with each release.
*/
// to avoid constant folding by the compiler, this field must *not* be final
- public static String REQUESTED_API_VERSION = "1.5.9"; // !final
+ public static String REQUESTED_API_VERSION = "1.5.9-RC0"; // !final
private StaticLoggerBinder() {
throw new UnsupportedOperationException("This code should have never made it into the jar");
diff --git a/slf4j-ext/pom.xml b/slf4j-ext/pom.xml
index 2568961..e2e9994 100644
--- a/slf4j-ext/pom.xml
+++ b/slf4j-ext/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-jcl/pom.xml b/slf4j-jcl/pom.xml
index 44047d5..d67aae5 100644
--- a/slf4j-jcl/pom.xml
+++ b/slf4j-jcl/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 4e04eab..767809a 100644
--- a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -65,7 +65,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
*/
//to avoid constant folding by the compiler, this field must *not* be final
- public static String REQUESTED_API_VERSION = "1.5.9";
+ public static String REQUESTED_API_VERSION = "1.5.9-RC0";
// Binding specific code:
private static final String loggerFactoryClassStr = JCLLoggerFactory.class
diff --git a/slf4j-jdk14/pom.xml b/slf4j-jdk14/pom.xml
index 8e5eb0f..0fd8f01 100644
--- a/slf4j-jdk14/pom.xml
+++ b/slf4j-jdk14/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 539b9ac..0ecce2c 100644
--- a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
* The value of this field is usually modified with each release.
*/
// to avoid constant folding by the compiler, this field must *not* be final
- public static String REQUESTED_API_VERSION = "1.5.9"; // !final
+ public static String REQUESTED_API_VERSION = "1.5.9-RC0"; // !final
private static final String loggerFactoryClassStr = org.slf4j.impl.JDK14LoggerFactory.class.getName();
diff --git a/slf4j-log4j12/pom.xml b/slf4j-log4j12/pom.xml
index 03ac84a..10e0a07 100644
--- a/slf4j-log4j12/pom.xml
+++ b/slf4j-log4j12/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index e9440d1..916959e 100644
--- a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
* against. The value of this field is usually modified with each release.
*/
// to avoid constant folding by the compiler, this field must *not* be final
- public static String REQUESTED_API_VERSION = "1.5.9"; // !final
+ public static String REQUESTED_API_VERSION = "1.5.9-RC0"; // !final
private static final String loggerFactoryClassStr = Log4jLoggerFactory.class
.getName();
diff --git a/slf4j-migrator/pom.xml b/slf4j-migrator/pom.xml
index 0f9e206..b8c02e1 100644
--- a/slf4j-migrator/pom.xml
+++ b/slf4j-migrator/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-nop/pom.xml b/slf4j-nop/pom.xml
index dd31504..d1e05de 100644
--- a/slf4j-nop/pom.xml
+++ b/slf4j-nop/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 6c14976..9d1d530 100644
--- a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
* The value of this field is usually modified with each release.
*/
// to avoid constant folding by the compiler, this field must *not* be final
- public static String REQUESTED_API_VERSION = "1.5.9"; // !final
+ public static String REQUESTED_API_VERSION = "1.5.9-RC0"; // !final
private static final String loggerFactoryClassStr = NOPLoggerFactory.class.getName();
diff --git a/slf4j-osgi-integration-test/pom.xml b/slf4j-osgi-integration-test/pom.xml
index 90df098..fe5a287 100644
--- a/slf4j-osgi-integration-test/pom.xml
+++ b/slf4j-osgi-integration-test/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-osgi-test-bundle/pom.xml b/slf4j-osgi-test-bundle/pom.xml
index 86995e9..4c446e5 100644
--- a/slf4j-osgi-test-bundle/pom.xml
+++ b/slf4j-osgi-test-bundle/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-simple/pom.xml b/slf4j-simple/pom.xml
index ad2a0ce..b5a1d1f 100644
--- a/slf4j-simple/pom.xml
+++ b/slf4j-simple/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 9f89f4d..9bb729c 100644
--- a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -58,7 +58,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
* against. The value of this field is usually modified with each release.
*/
// to avoid constant folding by the compiler, this field must *not* be final
- public static String REQUESTED_API_VERSION = "1.5.9"; // !final
+ public static String REQUESTED_API_VERSION = "1.5.9-RC0"; // !final
private static final String loggerFactoryClassStr = SimpleLoggerFactory.class.getName();
diff --git a/slf4j-site/pom.xml b/slf4j-site/pom.xml
index b1d41ec..c0ce349 100644
--- a/slf4j-site/pom.xml
+++ b/slf4j-site/pom.xml
@@ -5,7 +5,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>1.5.9-SNAPSHOT</version>
+ <version>1.5.9-RC0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html
index 71d3005..d9e8361 100644
--- a/slf4j-site/src/site/pages/news.html
+++ b/slf4j-site/src/site/pages/news.html
@@ -27,7 +27,7 @@
<hr noshade="noshade" size="1"/>
- <h3>XX, 2009 - Release of SLF4J 1.5.9-RC0</h3>
+ <h3>4th of September, 2009 - Release of SLF4J 1.5.9-RC0</h3>
<p>SLF4J version 1.5.9 consist of bug fixes and minor
enhancements. It is totally backward compatible with SLF4J version
@@ -37,11 +37,6 @@
support as a thin layer built upon the <a
href="http://cal10n.qos.ch">CAL10N API</a>.</p>
-
- <p>Added <a href="localization.html">localized/internationalized
- logging</a> support as a thin layer built upon the <a
- href="http://cal10n.qos.ch">CAL10N API</a>.</p>
-
<p>In log4j-over-slf4j, added missing log(...) methods. These were
requested by Zoltan Szel in <a
href="http://bugzilla.slf4j.org/show_bug.cgi?id=139">bug report
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=e69cd9fa619b82eb22a7a78decc34937b4c00870
http://github.com/ceki/slf4j/commit/e69cd9fa619b82eb22a7a78decc34937b4c00870
commit e69cd9fa619b82eb22a7a78decc34937b4c00870
Author: Ceki Gulcu <ceki at qos.ch>
Date: Fri Sep 4 19:50:15 2009 +0200
- Documenting LocLogger and co.
diff --git a/pom.xml b/pom.xml
index 95d7185..25eb1bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -80,7 +80,7 @@
<dependency>
<groupId>ch.qos.cal10n</groupId>
<artifactId>cal10n-api</artifactId>
- <version>0.5.1</version>
+ <version>0.7</version>
</dependency>
</dependencies>
diff --git a/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java b/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java
index 4ce9d70..ed3a743 100644
--- a/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java
+++ b/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLogger.java
@@ -21,8 +21,6 @@
*/
package org.slf4j.cal10n;
-import java.util.Locale;
-
import org.slf4j.Logger;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
@@ -30,7 +28,6 @@ import org.slf4j.ext.LoggerWrapper;
import org.slf4j.spi.LocationAwareLogger;
import ch.qos.cal10n.IMessageConveyor;
-import ch.qos.cal10n.MessageConveyor;
import ch.qos.cal10n.MessageParameterObj;
/**
@@ -50,13 +47,14 @@ public class LocLogger extends LoggerWrapper implements Logger {
*/
static Marker LOCALIZED = MarkerFactory.getMarker("LOCALIZED");
- final Locale locale;
final IMessageConveyor imc;
- public LocLogger(Logger logger, Locale locale) {
+ public LocLogger(Logger logger, IMessageConveyor imc) {
super(logger, LoggerWrapper.class.getName());
- this.locale = locale;
- imc = new MessageConveyor(locale);
+ if(imc == null) {
+ throw new IllegalArgumentException("IMessageConveyor cannot be null");
+ }
+ this.imc = imc;
}
/**
diff --git a/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLoggerFactory.java b/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLoggerFactory.java
index d744104..6589484 100644
--- a/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLoggerFactory.java
+++ b/slf4j-ext/src/main/java/org/slf4j/cal10n/LocLoggerFactory.java
@@ -21,11 +21,11 @@
*/
package org.slf4j.cal10n;
-import java.util.Locale;
-
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import ch.qos.cal10n.IMessageConveyor;
+
/**
*
* This class is essentially a wrapper around an {@link LoggerFactory} producing
@@ -34,19 +34,19 @@ import org.slf4j.LoggerFactory;
* <p>
* Contrary to {@link LoggerFactory#getLogger(String)} method of
* {@link LoggerFactory}, each call to {@link getLocLogger} produces a new
- * instance of {@link LocLogger}. This should not matter because an XLogger
- * instance does have any state beyond that of the {@link Logger} instance
- * it wraps and its locale.
+ * instance of {@link LocLogger}. This should not matter because a LocLogger
+ * instance does have any state beyond that of the {@link Logger} in stance it
+ * wraps and its message conveyor.
*
- * @author Ceki Gulcu
+ * @author Ceki Gücü
*
*/
public class LocLoggerFactory {
- final Locale locale;
+ final IMessageConveyor imc;
- public LocLoggerFactory(Locale locale) {
- this.locale = locale;
+ public LocLoggerFactory(IMessageConveyor imc) {
+ this.imc = imc;
}
/**
@@ -56,7 +56,7 @@ public class LocLoggerFactory {
* @return
*/
public LocLogger getLocLogger(String name) {
- return new LocLogger(LoggerFactory.getLogger(name), locale);
+ return new LocLogger(LoggerFactory.getLogger(name), imc);
}
/**
diff --git a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/LocLoggerTest.java b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/LocLoggerTest.java
index 48e4c51..690474d 100644
--- a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/LocLoggerTest.java
+++ b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/LocLoggerTest.java
@@ -32,12 +32,16 @@ import org.slf4j.cal10n.LocLogger;
import org.slf4j.cal10n.LocLoggerFactory;
import org.slf4j.dummyExt.ListAppender;
+import ch.qos.cal10n.IMessageConveyor;
+import ch.qos.cal10n.MessageConveyor;
+
public class LocLoggerTest extends TestCase {
ListAppender listAppender;
org.apache.log4j.Logger log4jRoot;
- LocLoggerFactory llFactory_uk = new LocLoggerFactory(Locale.UK);
+ IMessageConveyor imc = new MessageConveyor(Locale.UK);
+ LocLoggerFactory llFactory_uk = new LocLoggerFactory(imc);
final static String EXPECTED_FILE_NAME = "LocLoggerTest.java";
diff --git a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Months.java b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Months.java
index 679e7c4..5f4bceb 100644
--- a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Months.java
+++ b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Months.java
@@ -1,8 +1,8 @@
package org.slf4j.cal10n_dummy;
-import ch.qos.cal10n.ResourceBundleName;
+import ch.qos.cal10n.BaseName;
- at ResourceBundleName("months")
+ at BaseName("months")
public enum Months {
JAN, FEB, MAR, APR, MAY, JUN;
diff --git a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/MyApplication.java b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/MyApplication.java
new file mode 100644
index 0000000..fd9d7d2
--- /dev/null
+++ b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/MyApplication.java
@@ -0,0 +1,32 @@
+package org.slf4j.cal10n_dummy;
+
+import java.util.Locale;
+
+import org.slf4j.cal10n.LocLogger;
+import org.slf4j.cal10n.LocLoggerFactory;
+
+import ch.qos.cal10n.IMessageConveyor;
+import ch.qos.cal10n.MessageConveyor;
+
+public class MyApplication {
+
+ // create a message conveyor for a given locale
+ IMessageConveyor messageConveyor = new MessageConveyor(Locale.UK);
+
+ // create the LogLoggerFactory
+ LocLoggerFactory llFactory_uk = new LocLoggerFactory(messageConveyor);
+
+ // create a locLogger
+ LocLogger locLogger = llFactory_uk.getLocLogger(this.getClass());
+
+
+ public void applicationStart() {
+ locLogger.info(Production.APPLICATION_STARTED);
+ // ..
+ }
+
+ public void applicationStop() {
+ locLogger.info(Production.APPLICATION_STOPPED);
+ // ...
+ }
+}
diff --git a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/PackageTest.java b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/PackageTest.java
new file mode 100644
index 0000000..cfcb835
--- /dev/null
+++ b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/PackageTest.java
@@ -0,0 +1,12 @@
+package org.slf4j.cal10n_dummy;
+
+import junit.framework.*;
+
+public class PackageTest extends TestCase {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite();
+ suite.addTestSuite(LocLoggerTest.class);
+ return suite;
+ }
+}
diff --git a/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Production.java b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Production.java
new file mode 100644
index 0000000..95fce9d
--- /dev/null
+++ b/slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Production.java
@@ -0,0 +1,14 @@
+package org.slf4j.cal10n_dummy;
+
+import ch.qos.cal10n.LocaleData;
+import ch.qos.cal10n.Locale;
+import ch.qos.cal10n.BaseName;
+
+ at BaseName("production")
+ at LocaleData( { @Locale("en_UK"), @Locale("fr") })
+public enum Production {
+ APPLICATION_STARTED,
+ APPLICATION_STOPPED,
+ DB_CONNECTION,
+ DB_CONNECTION_FAILURE;
+}
\ No newline at end of file
diff --git a/slf4j-site/src/site/pages/docs.html b/slf4j-site/src/site/pages/docs.html
index 4cde2a7..989b1ca 100644
--- a/slf4j-site/src/site/pages/docs.html
+++ b/slf4j-site/src/site/pages/docs.html
@@ -29,6 +29,9 @@
<li><a href="legacy.html">Bridging legacy APIs</a></li>
<li><a href="migrator.html">SLF4J migrator</a></li>
<li><a href="extensions.html">SLF4J extensions</a></li>
+
+ <li><a href="localization.html">Localization/Internalization support</a></li>
+
<li><a href="apidocs/index.html">javadocs</a></li>
<li>
<a href="xref/index.html">sources</a>,
diff --git a/slf4j-site/src/site/pages/download.html b/slf4j-site/src/site/pages/download.html
index 366b336..57c970b 100644
--- a/slf4j-site/src/site/pages/download.html
+++ b/slf4j-site/src/site/pages/download.html
@@ -24,6 +24,16 @@
<p>Download version ${project.version} including <i>full source code</i>,
class files and documentation in ZIP or TAR.GZ format: </p>
+ <p>Stable version</p>
+
+ <ul>
+ <li><a href="dist/slf4j-1.5.8.tar.gz"><b>slf4j-1.5.8.tar.gz</b></a> </li>
+ <li><a href="dist/slf4j-1.5.8.zip"><b>slf4j-1.5.8.zip</b></a> </li>
+
+ </ul>
+
+ <p>Release candidate</p>
+
<ul>
<li><a href="dist/slf4j-${project.version}.tar.gz"><b>slf4j-${project.version}.tar.gz</b></a> </li>
<li><a href="dist/slf4j-${project.version}.zip"><b>slf4j-${project.version}.zip</b></a> </li>
diff --git a/slf4j-site/src/site/pages/extensions.html b/slf4j-site/src/site/pages/extensions.html
index 8d8d68a..fea45ac 100644
--- a/slf4j-site/src/site/pages/extensions.html
+++ b/slf4j-site/src/site/pages/extensions.html
@@ -7,10 +7,11 @@
<title>SLF4J extensions</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/site.css" />
+ <link rel="stylesheet" type="text/css" href="css/prettify.css" />
</head>
- <body>
+ <body onload="prettyPrint()">
<script type="text/javascript">prefix='';</script>
-
+ <script type="text/javascript" src="js/prettify.js"></script>
<script src="templates/header.js" type="text/javascript"></script>
<div id="left">
<script src="templates/left.js" type="text/javascript"></script>
@@ -56,7 +57,7 @@
<em>Example: Using the profiler: <a
href="xref-test/org/slf4j/profiler/BasicProfilerDemo.html">BasicProfilerDemo</a></em>
- <p class="source">[omitted]
+ <pre class="prettyprint source">[omitted]
32 public class BasicProfilerDemo {
33
34 public static void main(String[] args) {
@@ -72,7 +73,7 @@
44 doOther();
45 <b>profiler.stop().print();</b>
46 }
-[omitted]</p>
+[omitted]</pre>
<p>Running the above example will output the following output.</p>
@@ -119,7 +120,7 @@
href="xref-test/org/slf4j/profiler/NestedProfilerDemo.html">NestedProfilerDemo</a>
</em>
- <p class="source">33 public class NestedProfilerDemo {
+ <pre class="prettyprint source">33 public class NestedProfilerDemo {
34
35 public static void main(String[] args) {
36 // create a profiler called "DEMO"
@@ -148,14 +149,14 @@
59 // stop and print the "DEMO" printer
60 profiler.stop().print();
61 }
-62 }</p>
+62 }</pre>
<p>Here is the relevant excerpt from the <a
href="xref-test/org/slf4j/profiler/SortAndPruneComposites.html">SortAndPruneComposites</a>
class.
</p>
- <p class="source">[omitted]
+ <pre class="prettyprint source">[omitted]
6 public class SortAndPruneComposites {
7
8 static String NESTED_PROFILER_NAME = "SORT_AND_PRUNE";
@@ -183,7 +184,7 @@
30
31 return result;
32 }
-[omitted] </p>
+[omitted] </pre>
<p>On a Dual-Core Intel CPU clocked at 3.2 GHz, running the
@@ -229,7 +230,7 @@
href="xref-test/org/slf4j/profiler/NestedProfilerDemo2.html">NestedProfilerDemo2</a>
</em>
- <p class="source">[omitted]
+ <pre class="prettyprint source">[omitted]
17 public class NestedProfilerDemo2 {
18
19 static Logger logger = LoggerFactory.getLogger(NestedProfilerDemo2.class);
@@ -255,7 +256,7 @@
39 // stop and log
40 profiler.stop().<b>log()</b>;
41 }
-42 } </p>
+42 } </pre>
<p>The output generated by this example will depend on the logging
environment, but should be very similar to the output generated by
@@ -276,7 +277,7 @@
<em>logback configuration disabling logging from profilers, and only
profilers</em>
- <p class="source"><configuration>
+ <pre class="prettyprint source"><configuration>
<b><turboFilter class="ch.qos.logback.classic.turbo.MarkerFilter">
<Marker>PROFILER</Marker>
@@ -294,7 +295,7 @@
<level value="DEBUG" />
<appender-ref ref="STDOUT" />
</root>
-</configuration> </p>
+</configuration> </pre>
<!-- .............................................................. -->
@@ -398,7 +399,7 @@
not handled.
</p>
- <p class="source">package com.test;
+ <pre class="prettyprint source">package com.test;
import org.slf4j.ext.XLogger;
import org.slf4j.ext.XLoggerFactory;
@@ -449,13 +450,13 @@ public class TestService {
logger.exit(key);
return key;
}
-}</p>
+}</pre>
<p>This test application uses the preceding service to generate
logging events.
</p>
- <p class="source">package com.test;
+ <pre class="prettyprint source">package com.test;
public class App {
public static void main( String[] args ) {
@@ -464,7 +465,7 @@ public class App {
service.retrieveMessage();
service.exampleException();
}
-} </p>
+} </pre>
<p>The configuration below will cause all output to be routed to
target/test.log. The pattern for the FileAppender includes the
@@ -472,7 +473,7 @@ public class App {
pattern are critical for the log to be of value.
</p>
- <p class="source"><?xml version='1.0' encoding='UTF-8'?>
+ <pre class="prettyprint source"><?xml version='1.0' encoding='UTF-8'?>
<configuration>
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -497,7 +498,7 @@ public class App {
<appender-ref ref="log" />
</root>
</configuration>
-</p>
+</pre>
<p>
Here is the output that results from the Java classes and configuration above.
</p>
@@ -596,7 +597,7 @@ java.lang.ArrayIndexOutOfBoundsException: 3
occurs an EventData object should be created and populated. Then call EventLogger.logEvent(data)
where data is a reference to the EventData object.</p>
- <p class="source">import org.slf4j.MDC;
+ <pre class="prettyprint source">import org.slf4j.MDC;
import org.apache.commons.lang.time.DateUtils;
import javax.servlet.Filter;
@@ -666,10 +667,10 @@ public class RequestFilter implements Filter
public void destroy() {
}
-}
- </p>
+} </pre>
+
<p>Sample class that uses EventLogger.</p>
- <p class="source">import org.slf4j.ext.EventData;
+ <pre class="prettyprint source">import org.slf4j.ext.EventData;
import org.slf4j.ext.EventLogger;
import java.util.Date;
@@ -691,11 +692,11 @@ public class MyApp {
EventLogger.logEvent(data);
return confirm;
}
-}
- </p>
+} </pre>
+
<p>The EventLogger class uses a Logger named "EventLogger". EventLogger uses a logging level
of INFO. The following shows a configuraton using Logback.</p>
- <p class="source"><configuration>
+ <pre class="prettyprint source"><configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
@@ -717,8 +718,7 @@ public class MyApp {
<appender-ref ref="STDOUT" />
</root>
-</configuration>
- </p>
+</configuration> </pre>
<!-- .............................................................. -->
@@ -761,15 +761,15 @@ public class MyApp {
<p>Given the well-known "Hello World" example:</p>
- <p class="source">public class HelloWorld {
+ <pre class="prettyprint source">public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World");
}
-}</p>
+}</pre>
<p>a typical transformation would be similar to: (imports omitted)</p>
- <p class="source">public class LoggingHelloWorld {
+ <pre class="prettyprint source">public class LoggingHelloWorld {
final static Logger _log = LoggerFactory.getLogger(LoggingHelloWorld.class.getName());
public static void main(String args[]) {
@@ -781,7 +781,7 @@ public class MyApp {
_log.info("< main()");
}
}
-}</p>
+}</pre>
<p>which in turn produces the following result when run similar to
"java LoggingHelloWorld 1 2 3 4":
diff --git a/slf4j-site/src/site/pages/faq.html b/slf4j-site/src/site/pages/faq.html
index ae8d2fe..586acf4 100644
--- a/slf4j-site/src/site/pages/faq.html
+++ b/slf4j-site/src/site/pages/faq.html
@@ -935,33 +935,12 @@ logger.debug("The new entry is {}.", entry);</pre>
</dt>
<dd>
- <p>No. SLF4J does not offer any particular support for
- I18N. However, nothing prevents you from implementing i18n
- support around the SLF4J API.</p>
-
- <p>As suggested by Sebastien Davids in <a
- href="http://bugzilla.slf4j.org/show_bug.cgi?id=50">bug report
- 50</a>, a possible pattern might be:</p>
-
- <pre class="prettyprint source">class MyClass {
-
- ResourceBundle bundle = ResourceBundle.getBundle("my.package.messages");
- Logger logger = LoggerFactory.getLogger(MyClass.class);
-
- void method() {
- if (logger.isWarnEnabled()) {
- MessageFormat format = new MessageFormat(bundle.getString("<b>my_message_key</b>"));
- logger.warn(format.format(new Object[] { new Date(), 1 }));
- }
- }
-}</pre>
-
- <p>Where <code>my_message_key</code> is defined as</p>
- <pre class="prettyprint source"><b>my_message_key</b>=my text to be i18n {1,date,short} {0,number,00}</pre>
-
-
-
-
+ <p>Yes, as of version 1.5.9, SLF4J ships with a package called
+ <code>org.slf4j.cal10n</code> which adds <a
+ href="localization.html">localized/internationalized logging</a>
+ support as a thin layer built upon the <a
+ href="http://cal10n.qos.ch">CAL10N API</a>.</p>
+
</dd>
</dl>
diff --git a/slf4j-site/src/site/pages/localization.html b/slf4j-site/src/site/pages/localization.html
new file mode 100644
index 0000000..e9840a3
--- /dev/null
+++ b/slf4j-site/src/site/pages/localization.html
@@ -0,0 +1,122 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <title>Localization</title>
+ <link rel="stylesheet" type="text/css" media="screen" href="css/site.css" />
+ <link rel="stylesheet" type="text/css" href="css/prettify.css" />
+ </head>
+ <body onload="prettyPrint()">
+
+ <script type="text/javascript">prefix='';</script>
+
+ <script type="text/javascript" src="js/prettify.js"></script>
+ <script src="templates/header.js" type="text/javascript"></script>
+ <div id="left">
+ <noscript>Please turn on Javascript to view this menu</noscript>
+ <script src="templates/left.js" type="text/javascript"></script>
+ </div>
+
+ <div id="content">
+
+
+ <h1>Localization support</h1>
+
+ <p>A <a
+ href="http://markmail.org/thread/drcabfc6z42sijdo">discussion</a>
+ on the slf4j-dev mailing list spawned an open-source project
+ called <a href="http://cal10n.qos.ch"><b>CAL10N or Compiler
+ Assisted Localization</b></a>. As its name indicates, CAL10N
+ focuses on the issue of localization/internationalization in Java
+ applications.
+ </p>
+
+ <p>The <code>org.slf4j.cal10n</code> package which ships with
+ <em>slf4j-ext-${project.version}.jar</em> adds an extremely thin
+ layer on top of CALI0N to offer localized logging.</p>
+
+
+ <p>Once you have a handle on an <a
+ href="http://cal10n.qos.ch/apidocs/ch/qos/cal10n/IMessageConveyor.html">IMessageConveyor</a>
+ instance, you can create a <a
+ href="xref/org/slf4j/cal10n/LocLoggerFactory.html">LocLoggerFactory</a>,
+ which in turn can create a <a
+ href="xref/org/slf4j/cal10n/LocLogger.html">LocLogger</a>
+ instances capable of doing localized logging.
+ </p>
+
+
+ <p>Let assume that you have defined localized message your
+ application. In accordance with the CAL10N's philopshopy, you have
+ the declared the keys for those messages in the enum type
+ <code>Production</code>.</p>
+
+
+ <pre class="prettyprint source">import ch.qos.cal10n.LocaleData;
+import ch.qos.cal10n.Locale;
+import ch.qos.cal10n.BaseName;
+
+ at BaseName("production")
+ at LocaleData( { @Locale("en_UK"), @Locale("ja_JP") })
+public enum Production {
+ APPLICATION_STARTED,
+ APPLICATION_STOPPED,
+ ...
+ DB_CONNECTION,
+ DB_CONNECTION_FAILURE;
+}</pre>
+
+ <p>It is assumed that you have created appropriate bundle file for
+ the various locales "en_UK" and "ja_JP" as appropriate. Then, you
+ can instantiate a <code>IMessageCoveyor</code>, inject it into a
+ <code>LogLoggerFactory</code>, retreive multiple
+ <code>LogLogger</code> instances by name and log away, as the next
+ sample code illustrates.
+ </p>
+
+
+ <pre class="prettyprint source">import java.util.Locale;
+
+import org.slf4j.cal10n.LocLogger;
+import org.slf4j.cal10n.LocLoggerFactory;
+
+import ch.qos.cal10n.IMessageConveyor;
+import ch.qos.cal10n.MessageConveyor;
+
+public class MyApplication {
+
+ // create a message conveyor for a given locale
+ IMessageConveyor messageConveyor = new MessageConveyor(Locale.JAPAN);
+
+ // create the LogLoggerFactory
+ LocLoggerFactory llFactory_uk = new LocLoggerFactory(messageConveyor);
+
+ // create a locLogger
+ LocLogger locLogger = llFactory_uk.getLocLogger(this.getClass());
+
+
+ public void applicationStart() {
+ locLogger.info(Production.APPLICATION_STARTED);
+ // ..
+ }
+
+ public void applicationStop() {
+ locLogger.info(Production.APPLICATION_STOPPED);
+ // ...
+ }
+}</pre>
+
+ <p>Assuming the resource bundle <em>production_jp.properties</em>
+ exists, and the underlying logging framework is enabled for the
+ info level, log messages in Japenese will be output.
+ </p>
+
+ <p>Note that a <code>LogLogger</code> is a regular SLF4J logger
+ with additional methods supporting localization.</p>
+
+ <script src="templates/footer.js" type="text/javascript"></script>
+ </div>
+ </body>
+</html>
diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html
index 0623fc3..71d3005 100644
--- a/slf4j-site/src/site/pages/news.html
+++ b/slf4j-site/src/site/pages/news.html
@@ -27,15 +27,20 @@
<hr noshade="noshade" size="1"/>
- <h3>XX, 2009 - Release of SLF4J 1.5.9</h3>
+ <h3>XX, 2009 - Release of SLF4J 1.5.9-RC0</h3>
<p>SLF4J version 1.5.9 consist of bug fixes and minor
enhancements. It is totally backward compatible with SLF4J version
- 1.5.8. However, based on the <a href="http://cal10n.qos.ch/">CAL10N
- project</a> support for internationalization was added to the
- slf4j-ext module.</p>
+ 1.5.8. However, the slf4j-ext module ships with a new package called
+ <code>org.slf4j.cal10n</code> which adds <a
+ href="localization.html">localized/internationalized logging</a>
+ support as a thin layer built upon the <a
+ href="http://cal10n.qos.ch">CAL10N API</a>.</p>
-
+
+ <p>Added <a href="localization.html">localized/internationalized
+ logging</a> support as a thin layer built upon the <a
+ href="http://cal10n.qos.ch">CAL10N API</a>.</p>
<p>In log4j-over-slf4j, added missing log(...) methods. These were
requested by Zoltan Szel in <a
@@ -56,6 +61,8 @@
href="http://bugzilla.slf4j.org/show_bug.cgi?id=146">bug report
146</a> by Dapeng Ni.</p>
+
+
<hr noshade="noshade" size="1"/>
<h3>June 11th, 2009 - Release of SLF4J 1.5.8</h3>
-----------------------------------------------------------------------
Summary of changes:
integration/pom.xml | 2 +-
jcl-over-slf4j/pom.xml | 2 +-
jcl104-over-slf4j/pom.xml | 2 +-
jul-to-slf4j/pom.xml | 2 +-
log4j-over-slf4j/pom.xml | 2 +-
osgi-over-slf4j/pom.xml | 2 +-
pom.xml | 4 +-
slf4j-api/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-ext/pom.xml | 2 +-
.../src/main/java/org/slf4j/cal10n/LocLogger.java | 12 +-
.../java/org/slf4j/cal10n/LocLoggerFactory.java | 20 ++--
.../java/org/slf4j/cal10n_dummy/LocLoggerTest.java | 6 +-
.../test/java/org/slf4j/cal10n_dummy/Months.java | 4 +-
.../java/org/slf4j/cal10n_dummy/MyApplication.java | 32 +++++
.../{dummyExt => cal10n_dummy}/PackageTest.java | 6 +-
.../java/org/slf4j/cal10n_dummy/Production.java | 14 +++
slf4j-jcl/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-jdk14/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-log4j12/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-migrator/pom.xml | 2 +-
slf4j-nop/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-osgi-integration-test/pom.xml | 2 +-
slf4j-osgi-test-bundle/pom.xml | 2 +-
slf4j-simple/pom.xml | 2 +-
.../java/org/slf4j/impl/StaticLoggerBinder.java | 2 +-
slf4j-site/pom.xml | 2 +-
slf4j-site/src/site/pages/docs.html | 3 +
slf4j-site/src/site/pages/download.html | 10 ++
slf4j-site/src/site/pages/extensions.html | 62 +++++-----
slf4j-site/src/site/pages/faq.html | 33 +-----
slf4j-site/src/site/pages/localization.html | 122 ++++++++++++++++++++
slf4j-site/src/site/pages/news.html | 14 ++-
37 files changed, 275 insertions(+), 113 deletions(-)
create mode 100644 slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/MyApplication.java
copy slf4j-ext/src/test/java/org/slf4j/{dummyExt => cal10n_dummy}/PackageTest.java (50%)
create mode 100644 slf4j-ext/src/test/java/org/slf4j/cal10n_dummy/Production.java
create mode 100644 slf4j-site/src/site/pages/localization.html
hooks/post-receive
--
SLF4J: Simple Logging Facade for Java
More information about the slf4j-dev
mailing list