Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: class loader issue caused by logging libraries
- slf4j runtime is no longer provided by Toolbox
- the sample code promotes the usage of service locator
  to resolve a logger. However, this approach has a couple
  of downsides, mainly it tightly couples all layers of code
  because the service locator needs to be propagated from the
  dev extension down to the lowest level of coder business
  implementation.
- instead, we now pack tinylog with slf4j bindings to avoid
  classloading issues.
  • Loading branch information
fioan89 committed Feb 17, 2025
commit d1e4e955512f3b4c0b79f5d047cef466f57f7b0c
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jvmWrapper {
dependencies {
compileOnly(libs.bundles.toolbox.plugin.api)
implementation(libs.slf4j)
implementation(libs.tinylog)
implementation(libs.bundles.serialization)
implementation(libs.coroutines.core)
implementation(libs.okhttp)
Expand Down Expand Up @@ -111,7 +112,6 @@ val copyPlugin by tasks.creating(Sync::class.java) {
"core-api",
"ui-api",
"annotations",
"slf4j",
).any { file.name.contains(it) }
}
},
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ coroutines = "1.7.3"
serialization = "1.5.0"
okhttp = "4.10.0"
slf4j = "2.0.3"
tinylog = "2.7.0"
dependency-license-report = "2.5"
marketplace-client = "2.0.38"
gradle-wrapper = "0.14.0"
Expand All @@ -23,6 +24,7 @@ serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-jso
serialization-json-okio = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json-okio", version.ref = "serialization" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
tinylog = {module = "org.tinylog:slf4j-tinylog", version.ref = "tinylog"}
exec = { module = "org.zeroturnaround:zt-exec", version.ref = "exec" }
moshi = { module = "com.squareup.moshi:moshi", version.ref = "moshi"}
moshi-codegen = { module = "com.squareup.moshi:moshi-kotlin-codegen", version.ref = "moshi"}
Expand Down
Loading