From 464068bbfb7c008e72df9978742eada81d07cbc9 Mon Sep 17 00:00:00 2001 From: Andrei Cristea Date: Fri, 30 Jan 2026 17:27:29 +0100 Subject: [PATCH] build: add SLF4J SimpleLogger configuration for tests --- build.gradle.kts | 4 ++- .../core/util/logging/spi/package-info.java | 6 ++++ src/test/resources/simplelogger.properties | 36 +++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/eclipse/keyple/core/util/logging/spi/package-info.java create mode 100644 src/test/resources/simplelogger.properties diff --git a/build.gradle.kts b/build.gradle.kts index 5392d1d..80f1178 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,8 +14,10 @@ plugins { /////////////////////////////////////////////////////////////////////////////// dependencies { - implementation("org.slf4j:slf4j-api:1.7.32") implementation("com.google.code.gson:gson:2.10.1") + implementation("org.slf4j:slf4j-api:1.7.32") + + testImplementation("org.slf4j:slf4j-simple:1.7.32") testImplementation(platform("org.junit:junit-bom:5.10.2")) testImplementation("org.junit.jupiter:junit-jupiter") testImplementation("org.junit.vintage:junit-vintage-engine") diff --git a/src/main/java/org/eclipse/keyple/core/util/logging/spi/package-info.java b/src/main/java/org/eclipse/keyple/core/util/logging/spi/package-info.java new file mode 100644 index 0000000..655bd32 --- /dev/null +++ b/src/main/java/org/eclipse/keyple/core/util/logging/spi/package-info.java @@ -0,0 +1,6 @@ +/** + * SPI interfaces associated with the logging abstraction layer. + * + * @since 2.5.0 + */ +package org.eclipse.keyple.core.util.logging.spi; diff --git a/src/test/resources/simplelogger.properties b/src/test/resources/simplelogger.properties new file mode 100644 index 0000000..3f352a5 --- /dev/null +++ b/src/test/resources/simplelogger.properties @@ -0,0 +1,36 @@ +# SLF4J's SimpleLogger configuration file +# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. + +# Default logging detail level for all instances of SimpleLogger. +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, defaults to "info". +org.slf4j.simpleLogger.defaultLogLevel=info + +# Logging detail level for a SimpleLogger instance named "xxxxx". +# Must be one of ("trace", "debug", "info", "warn", or "error"). +# If not specified, the default logging detail level is used. +#org.slf4j.simpleLogger.log.xxxxx= + +# Set to true if you want the current date and time to be included in output messages. +# Default is false, and will output the number of milliseconds elapsed since startup. +org.slf4j.simpleLogger.showDateTime=true + +# The date and time format to be used in the output messages. +# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. +# If the format is not specified or is invalid, the default format is used. +# The default format is yyyy-MM-dd HH:mm:ss:SSS Z. +org.slf4j.simpleLogger.dateTimeFormat=[HH:mm:ss:SSS] + +# Set to true if you want to output the current thread name. +# Defaults to true. +org.slf4j.simpleLogger.showThreadName=true + +# Set to true if you want the Logger instance name to be included in output messages. +# Defaults to true. +org.slf4j.simpleLogger.showLogName=false + +# Set to true if you want the last component of the name to be included in output messages. +# Defaults to false. +org.slf4j.simpleLogger.showShortLogName=true + +org.slf4j.simpleLogger.levelInBrackets=true \ No newline at end of file