Skip to content

Commit 2ffa761

Browse files
committed
added testImplementation of slf4jSimple to :core. Disabled FastDoubleParser debug logs for :core:test, except for FastDoubleParserTests
1 parent 7695fb2 commit 2ffa761

File tree

3 files changed

+43
-5
lines changed

3 files changed

+43
-5
lines changed

core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ dependencies {
8787
}
8888
testImplementation(libs.kotlin.scriptingJvm)
8989
testImplementation(libs.jsoup)
90+
testImplementation(libs.sl4jsimple)
9091
}
9192

9293
val samplesImplementation by configurations.getting {

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/io/FastDoubleParserTests.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@ import org.junit.Test
99
import java.text.NumberFormat
1010
import java.util.Locale
1111

12-
private const val LOG_LEVEL = "org.slf4j.simpleLogger.defaultLogLevel"
13-
1412
class FastDoubleParserTests {
1513

14+
private val logLevel = "org.slf4j.simpleLogger.log.${FastDoubleParser::class.qualifiedName}"
1615
private var loggerBefore: String? = null
1716

1817
@Before
1918
fun setLogger() {
20-
loggerBefore = System.getProperty(LOG_LEVEL)
21-
System.setProperty(LOG_LEVEL, "debug")
19+
loggerBefore = System.getProperty(logLevel)
20+
System.setProperty(logLevel, "debug")
2221
}
2322

2423
@After
2524
fun restoreLogger() {
2625
if (loggerBefore != null) {
27-
System.setProperty(LOG_LEVEL, loggerBefore)
26+
System.setProperty(logLevel, loggerBefore)
2827
}
2928
}
3029

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SLF4J's SimpleLogger configuration file
2+
# Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err.
3+
4+
# Default logging detail level for all instances of SimpleLogger.
5+
# Must be one of ("trace", "debug", "info", "warn", or "error").
6+
# If not specified, defaults to "info".
7+
org.slf4j.simpleLogger.defaultLogLevel=debug
8+
9+
# Logging detail level for a SimpleLogger instance named "xxxxx".
10+
# Must be one of ("trace", "debug", "info", "warn", or "error").
11+
# If not specified, the default logging detail level is used.
12+
#org.slf4j.simpleLogger.log.xxxxx=
13+
14+
# Set to true if you want the current date and time to be included in output messages.
15+
# Default is false, and will output the number of milliseconds elapsed since startup.
16+
org.slf4j.simpleLogger.showDateTime=true
17+
18+
# The date and time format to be used in the output messages.
19+
# The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat.
20+
# If the format is not specified or is invalid, the default format is used.
21+
# The default format is yyyy-MM-dd HH:mm:ss:SSS Z.
22+
org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z
23+
24+
# Set to true if you want to output the current thread name.
25+
# Defaults to true.
26+
org.slf4j.simpleLogger.showThreadName=true
27+
28+
# Set to true if you want the Logger instance name to be included in output messages.
29+
# Defaults to true.
30+
org.slf4j.simpleLogger.showLogName=true
31+
32+
# Set to true if you want the last component of the name to be included in output messages.
33+
# Defaults to false.
34+
#org.slf4j.simpleLogger.showShortLogName=false
35+
36+
# Disables FastDoubleParser debug logs by default in our tests
37+
# Can be enabled by setting the system property programmatically
38+
org.slf4j.simpleLogger.log.org.jetbrains.kotlinx.dataframe.impl.io.FastDoubleParser=warn

0 commit comments

Comments
 (0)