Skip to content

Commit a5235cd

Browse files
committed
Add and configure Kotlin Logging
1 parent 85f5489 commit a5235cd

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ repositories {
88
}
99

1010
dependencies {
11+
implementation(libs.kotlin.logging)
1112
implementation(libs.kotlinx.coroutines.core)
1213

13-
// for tapSystemOut
14-
testImplementation(libs.system.lambda)
15-
testImplementation(libs.kotest.runner.junit5)
1614
testImplementation(libs.kotest.assertions.table)
15+
testImplementation(libs.kotest.runner.junit5)
16+
testImplementation(libs.system.lambda)
1717
testRuntimeOnly(libs.logback.classic)
1818
}
1919

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[versions]
22
kotest = "6.0.4"
33
kotlin = "2.2.21"
4+
kotlin-logging = "7.0.3"
45
kotlinx-coroutines = "1.10.2"
56
kover = "0.9.3"
67
logback = "1.5.20"
@@ -9,6 +10,7 @@ system-lambda = "1.2.1"
910
[libraries]
1011
kotest-assertions-table = { module = "io.kotest:kotest-assertions-table", version.ref = "kotest" }
1112
kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
13+
kotlin-logging = { module = "io.github.oshai:kotlin-logging-jvm", version.ref = "kotlin-logging" }
1214
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
1315
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
1416
system-lambda = { module = "com.github.stefanbirkner:system-lambda", version.ref = "system-lambda" }

src/main/resources/logback.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<configuration>
2+
<statusListener class="ch.qos.logback.core.status.NopStatusListener"/>
3+
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
4+
<encoder>
5+
<pattern>%d{HH:mm:ss.SSS} %-5level %msg%n</pattern>
6+
</encoder>
7+
</appender>
8+
<appender name="STDOUT_DETAILED" class="ch.qos.logback.core.ConsoleAppender">
9+
<encoder>
10+
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
11+
</encoder>
12+
</appender>
13+
14+
<root level="info">
15+
<appender-ref ref="STDOUT"/>
16+
</root>
17+
</configuration>

0 commit comments

Comments
 (0)