[Git][java-team/libslf4j2-java][upstream] New upstream version 2.0.20
Emmanuel Bourg (@ebourg)
gitlab at salsa.debian.org
Fri Oct 30 12:48:54 GMT 2026
Emmanuel Bourg pushed to branch upstream at Debian Java Maintainers / libslf4j2-java
Commits:
d7148638 by Emmanuel Bourg at 2026-10-30T13:44:16+01:00
New upstream version 2.0.20
- - - - -
20 changed files:
- integration/pom.xml
- jcl-over-slf4j/pom.xml
- jul-to-slf4j/pom.xml
- log4j-over-slf4j/pom.xml
- osgi-over-slf4j/pom.xml
- parent/pom.xml
- pom.xml
- slf4j-api/pom.xml
- slf4j-api/src/main/java/org/slf4j/Marker.java
- slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java
- slf4j-ext/pom.xml
- slf4j-jdk-platform-logging/pom.xml
- slf4j-jdk14/pom.xml
- slf4j-log4j12/pom.xml
- slf4j-migrator/pom.xml
- slf4j-nop/pom.xml
- slf4j-reload4j/pom.xml
- slf4j-simple/pom.xml
- − slf4j-simple/src/test/java/org/slf4j/simple/AcceptanceTest.java
- slf4j-simple/src/test/java/org/slf4j/simple/LoggerTestSuite.java → slf4j-simple/src/test/java/org/slf4j/simple/SimpleLoggerAcceptanceTest.java
Changes:
=====================================
integration/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
jcl-over-slf4j/pom.xml
=====================================
@@ -5,7 +5,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
jul-to-slf4j/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
log4j-over-slf4j/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
osgi-over-slf4j/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
parent/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-bom</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -26,7 +26,7 @@
<properties>
<!-- yyyy-MM-dd'T'HH:mm:ss'Z' -->
- <project.build.outputTimestamp>2026-09-04T09:59:00Z</project.build.outputTimestamp>
+ <project.build.outputTimestamp>2026-09-22T14:37:00Z</project.build.outputTimestamp>
<latest.1.version>1.7.36</latest.1.version>
<!-- java.util.ServiceLoader requires Java 6 -->
<jdk.version>8</jdk.version>
=====================================
pom.xml
=====================================
@@ -6,7 +6,7 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-bom</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<packaging>pom</packaging>
<url>http://www.slf4j.org</url>
=====================================
slf4j-api/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-api/src/main/java/org/slf4j/Marker.java
=====================================
@@ -71,6 +71,8 @@ public interface Marker extends Serializable {
* a reference to another marker
* @throws IllegalArgumentException
* if 'reference' is null
+ *
+ * @deprecated Markers are now immutable and no longer support children.
*/
public void add(Marker reference);
@@ -80,11 +82,13 @@ public interface Marker extends Serializable {
* @param reference
* the marker reference to remove
* @return true if reference could be found and removed, false otherwise.
+ *
+ * @deprecated Markers are now immutable and no longer support children.
*/
public boolean remove(Marker reference);
/**
- * @deprecated Replaced by {@link #hasReferences()}.
+ * @deprecated Markers are now immutable and no longer support children.
*/
@Deprecated
public boolean hasChildren();
@@ -93,6 +97,7 @@ public interface Marker extends Serializable {
* Does this marker have any references?
*
* @return true if this marker has one or more references, false otherwise.
+ * @deprecated Markers are now immutable and no longer support children.
*/
public boolean hasReferences();
@@ -101,6 +106,7 @@ public interface Marker extends Serializable {
* marker. An empty iterator is returned when this marker has no references.
*
* @return Iterator over the references of this marker
+ * @deprecated Markers are now immutable and no longer support children.
*/
public Iterator<Marker> iterator();
@@ -114,6 +120,7 @@ public interface Marker extends Serializable {
* @throws IllegalArgumentException
* if 'other' is null
* @return Whether this marker contains the other marker.
+ * @deprecated Markers are now immutable and no longer support children.
*/
public boolean contains(Marker other);
@@ -124,6 +131,7 @@ public interface Marker extends Serializable {
*
* @param name The marker name to test for inclusion.
* @return Whether this marker contains the other marker.
+ * @deprecated Markers are now immutable and no longer support children.
*/
public boolean contains(String name);
=====================================
slf4j-api/src/main/java/org/slf4j/helpers/BasicMarker.java
=====================================
@@ -53,6 +53,11 @@ public class BasicMarker implements Marker {
return name;
}
+ /**
+ * @deprecated Markers are now immutable and no longer support children.
+ */
+ @Override
+ @Deprecated
public void add(Marker reference) {
if (reference == null) {
throw new IllegalArgumentException("A null value cannot be added to a Marker as reference.");
@@ -70,23 +75,48 @@ public class BasicMarker implements Marker {
}
}
+ /**
+ * @deprecated Markers are now immutable and no longer support children.
+ */
+ @Override
+ @Deprecated
public boolean hasReferences() {
return (referenceList.size() > 0);
}
+ /**
+ * @deprecated Markers are now immutable and no longer support children.
+ */
+ @Override
@Deprecated
public boolean hasChildren() {
return hasReferences();
}
+ /**
+ * @deprecated Markers are now immutable and no longer support children.
+ */
+ @Override
+ @Deprecated
public Iterator<Marker> iterator() {
return referenceList.iterator();
}
+
+ /**
+ * @deprecated Markers are now immutable and no longer support children.
+ */
+ @Override
+ @Deprecated
public boolean remove(Marker referenceToRemove) {
return referenceList.remove(referenceToRemove);
}
+ /**
+ * @deprecated Markers are now immutable and no longer support children.
+ */
+ @Override
+ @Deprecated
public boolean contains(Marker other) {
if (other == null) {
throw new IllegalArgumentException("Other cannot be null");
=====================================
slf4j-ext/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-jdk-platform-logging/pom.xml
=====================================
@@ -8,7 +8,7 @@
<parent>
<artifactId>slf4j-parent</artifactId>
<groupId>org.slf4j</groupId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-jdk14/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-log4j12/pom.xml
=====================================
@@ -8,7 +8,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
@@ -24,7 +24,7 @@
<relocation>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-reload4j</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
</relocation>
</distributionManagement>
=====================================
slf4j-migrator/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-nop/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-reload4j/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-simple/pom.xml
=====================================
@@ -7,7 +7,7 @@
<parent>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-parent</artifactId>
- <version>2.0.19</version>
+ <version>2.0.20</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
=====================================
slf4j-simple/src/test/java/org/slf4j/simple/AcceptanceTest.java deleted
=====================================
@@ -1,50 +0,0 @@
-package org.slf4j.simple;
-
-import org.junit.Ignore;
-import org.slf4j.Logger;
-import org.slf4j.event.Level;
-
-import java.io.PrintStream;
-
- at Ignore
-public class AcceptanceTest extends LoggerTestSuite {
-
- @Override
- public Logger createLogger(ListAppendingOutputStream outputStream, Level level) {
- SimpleLogger.CONFIG_PARAMS.outputChoice = new OutputChoice(new PrintStream(outputStream));
-
- SimpleLogger logger = new SimpleLogger("TestSuiteLogger");
- logger.currentLogLevel = SimpleLoggerConfiguration.stringToLevel(level.toString());
- return logger;
- }
-
- @Override
- public String extractMessage(String message) {
- return message
- .split("\n")[0]
- .split("- ")[1];
- }
-
- @Override
- public String extractExceptionMessage(String message) {
- String[] logLines = message.split("\n");
-
- if (logLines.length < 2) {
- return null;
- }
- String exceptionLine = logLines[1];
- return exceptionLine.split(": ")[1];
- }
-
- @Override
- public String extractExceptionType(String message) {
- String[] logLines = message.split("\n");
-
- if (logLines.length < 2) {
- return null;
- }
- String exceptionLine = logLines[1];
- return exceptionLine.split(": ")[0];
- }
-
-}
\ No newline at end of file
=====================================
slf4j-simple/src/test/java/org/slf4j/simple/LoggerTestSuite.java → slf4j-simple/src/test/java/org/slf4j/simple/SimpleLoggerAcceptanceTest.java
=====================================
@@ -5,19 +5,124 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.event.Level;
+import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
-public abstract class LoggerTestSuite {
+/**
+ * Acceptance tests for the slf4j-simple SimpleLogger implementation.
+ *
+ * <p>This concrete JUnit test class exercises logging at different levels
+ * (TRACE, DEBUG, INFO, WARN, ERROR), verifies message formatting, and
+ * checks exception logging behavior. The class contains helper methods to
+ * create a logger that writes into a supplied {@link ListAppendingOutputStream}
+ * and to extract message and exception details from produced log lines.</p>
+ *
+ * <p>Important: these tests are predicated on the fact that {@code SimpleLogger}
+ * invokes {@code flush()} on the provided output stream after writing each
+ * log entry and that each logging event is accumulated into a single entry of
+ * the backing {@code List<String>} fiels in {@link ListAppendingOutputStream}.
+ * </p>
+ *
+ * <p>Each logging event — including events that contain a {@code Throwable}
+ * and produce stacktrace lines — is accumulated into the {@code targetList}
+ * field of {@link ListAppendingOutputStream} as a single entry representing
+ * the entire event. Tests expect one list element per logging event.</p>
+ *
+ */
+public class SimpleLoggerAcceptanceTest {
+ /**
+ * Create a {@link ListAppendingOutputStream} backed by the supplied list.
+ *
+ * <p>This helper returns an output stream that accumulates written text
+ * lines into the provided list. Tests rely on the {@code SimpleLogger}
+ * implementation to invoke {@code flush()} on the provided stream after
+ * writing each log entry so that bytes are converted into list entries and
+ * visible to assertions. </p>
+ *
+ * <p>Each logging event (including a {@code Throwable} and its stacktrace)
+ * is collected by {@code ListAppendingOutputStream} into a single element
+ * in its {@code targetList} field; tests expect one string element per event.</p>
+ *
+ * @param outputList the list which will receive captured log lines
+ * @return a new ListAppendingOutputStream writing into the supplied list
+ */
private ListAppendingOutputStream prepareSink(List<String> outputList) {
return new ListAppendingOutputStream(outputList);
}
+ /**
+ * Extracts only the part of the log string that should represent the `message` string.
+ *
+ * @param message the full log message
+ * @return only the supplied message
+ */
+ public String extractMessage(String message) {
+ // Example log line:
+ // [main] INFO TestSuiteLogger - An exception occurred: 99
+ return message
+ .split("\r?\n")[0]
+ .split("- ")[1];
+ }
+
+ /**
+ * Extracts only the part of the log string that should represent the supplied exception message, if any.
+ *
+ * @param message the full log message
+ * @return only the supplied exception message
+ */
+ public String extractExceptionMessage(String message) {
+ // Example log lines:
+ // [main] INFO TestSuiteLogger - An exception occurred: 99
+ // java.lang.IllegalArgumentException: Invalid argument
+ // at org.slf4j.simple.SimpleLoggerAcceptanceTest.testExceptionParameterFormatting(SimpleLoggerAcceptanceTest.java:274)
+
+ String[] logLines = message.split("\r?\n");
+
+ if(logLines.length < 2) {
+ return null;
+ }
+ String exceptionLine = logLines[1];
+ return exceptionLine.split(": ")[1];
+ }
+
+ /**
+ * Extracts only the part of the log string that should represent the supplied exception type.
+ *
+ * @param message the full log message
+ * @return only the supplied exception type name
+ */
+ public String extractExceptionType(String message) {
+ String[] logLines = message.split("\n");
+
+ if(logLines.length < 2) {
+ return null;
+ }
+ String exceptionLine = logLines[1];
+ return exceptionLine.split(": ")[0];
+ }
+
+ /**
+ * Configures the logger for running the tests.
+ *
+ * @param outputStream The output stream for logs to be written to
+ * @param level The expected level the tests will run for this logger
+ * @return a configured logger able to run the tests
+ */
+ public Logger createLogger(ListAppendingOutputStream outputStream, Level level) {
+ SimpleLogger.CONFIG_PARAMS.outputChoice = new OutputChoice(new PrintStream(outputStream));
+
+ SimpleLogger logger = new SimpleLogger("TestSuiteLogger");
+ logger.currentLogLevel = SimpleLoggerConfiguration.stringToLevel(level.toString());
+ return logger;
+ }
+
@Test
public void testTrace() {
ArrayList<String> outputList = new ArrayList<>();
@@ -56,8 +161,7 @@ public abstract class LoggerTestSuite {
assertEquals("Debug message should've been captured", 1, outputList.size());
assertTrue("Message should be logged in debug level", isDebugMessage(outputList.get(0)));
assertEquals("Supplied debug message wasn't found in the log",
- "Simple debug message",
- extractMessage(outputList.get(0)));
+ "Simple debug message", extractMessage(outputList.get(0)));
outputList.clear();
@@ -168,9 +272,38 @@ public abstract class LoggerTestSuite {
}
+ @Test
+ public void testExceptionParameterFormatting() {
+ ArrayList<String> outputList = new ArrayList<>();
+ Logger configuredLogger = createLogger(prepareSink(outputList), Level.INFO);
+
+ Exception exception = new IllegalArgumentException("Invalid argument");
+
+ configuredLogger.info("An exception occurred: {}", 99, exception);
+ assertEquals("The formatted message should've been captured", 1, outputList.size());
+ assertEquals("Message should've been formatted",
+ "An exception occurred: 99",
+ extractMessage(outputList.get(0)));
+
+ assertEquals("Exception type should've been captured",
+ "java.lang.IllegalArgumentException",
+ extractExceptionType(outputList.get(0)));
+
+
+ configuredLogger.info("Another exception occurred: {} {}", exception, 99);
+ assertEquals("The formatted message should've been captured", 2, outputList.size());
+ assertEquals("Message should've been formatted",
+ "Another exception occurred: java.lang.IllegalArgumentException: Invalid argument 99",
+ extractMessage(outputList.get(1)));
+
+ AtomicInteger atomicInteger = new AtomicInteger();
+ outputList.forEach(s -> System.out.println("x Log line " + (atomicInteger.getAndIncrement()) + ": " + s));
+ }
+
/**
* Allows tests to check whether the log message contains a trace message.
* Override if needed.
+ *
* @param message String containing the full log message
* @return whether it is a trace message or not
*/
@@ -181,6 +314,7 @@ public abstract class LoggerTestSuite {
/**
* Allows tests to check whether the log message contains a debug message.
* Override if needed.
+ *
* @param message String containing the full log message
* @return whether it is a debug message or not
*/
@@ -191,6 +325,7 @@ public abstract class LoggerTestSuite {
/**
* Allows tests to check whether the log message contains an info message.
* Override if needed.
+ *
* @param message String containing the full log message
* @return whether it is an info message or not
*/
@@ -201,6 +336,7 @@ public abstract class LoggerTestSuite {
/**
* Allows tests to check whether the log message contains a warn message.
* Override if needed.
+ *
* @param message String containing the full log message
* @return whether it is a warn message or not
*/
@@ -211,6 +347,7 @@ public abstract class LoggerTestSuite {
/**
* Allows tests to check whether the log message contains an error message.
* Override if needed.
+ *
* @param message String containing the full log message
* @return whether it is an error message or not
*/
@@ -218,33 +355,4 @@ public abstract class LoggerTestSuite {
return message.toLowerCase().contains("error");
}
- /**
- * Extracts only the part of the log string that should represent the `message` string.
- * @param message the full log message
- * @return only the supplied message
- */
- public abstract String extractMessage(String message);
-
- /**
- * Extracts only the part of the log string that should represent the supplied exception message, if any.
- * @param message the full log message
- * @return only the supplied exception message
- */
- public abstract String extractExceptionMessage(String message);
-
- /**
- * Extracts only the part of the log string that should represent the supplied exception type.
- * @param message the full log message
- * @return only the supplied exception type name
- */
- public abstract String extractExceptionType(String message);
-
- /**
- * Configures the logger for running the tests.
- * @param outputStream The output stream for logs to be written to
- * @param level The expected level the tests will run for this logger
- * @return a configured logger able to run the tests
- */
- public abstract Logger createLogger(ListAppendingOutputStream outputStream, Level level);
-
-}
\ No newline at end of file
+}
View it on GitLab: https://salsa.debian.org/java-team/libslf4j2-java/-/commit/d7148638db1bc3c05d618d514ae501f3678d43bc
--
View it on GitLab: https://salsa.debian.org/java-team/libslf4j2-java/-/commit/d7148638db1bc3c05d618d514ae501f3678d43bc
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20261030/965e201d/attachment.htm>
More information about the pkg-java-commits
mailing list