Skip to content

Commit 6af9a82

Browse files
committed
Improved debug logging.
1 parent 5c9e8a5 commit 6af9a82

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

build-logic/src/main/kotlin/org/sdkotlin/buildlogic/artifacts/dsl/AttributesDependencyCreationExtension.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.gradle.api.artifacts.dsl.DependencyHandler
66
import org.gradle.api.attributes.AttributeContainer
77
import org.gradle.api.provider.Provider
88
import org.gradle.api.provider.ProviderFactory
9+
import org.slf4j.LoggerFactory
910

1011
/**
1112
* A [DependencyHandler] extension that sets the attributes for variants of a
@@ -17,11 +18,21 @@ class AttributesDependencyCreationExtension(
1718
private val attributesConfigureAction: AttributeContainer.() -> Unit,
1819
) : DependencyCreationExtension {
1920

21+
private val logger = LoggerFactory.getLogger(this::class.java)
22+
2023
override fun invoke(notation: Any): Provider<Dependency> =
2124
providers.provider {
2225

2326
// TODO: Remove debug logging.
24-
RuntimeException("Creating $notation...").printStackTrace()
27+
try {
28+
throw RuntimeException(
29+
"Attributes dependency helper stacktrace"
30+
)
31+
} catch (e: RuntimeException) {
32+
logger.warn(
33+
"Creating $notation...", e
34+
)
35+
}
2536

2637
val dependency = dependencyHandler.create(notation)
2738

0 commit comments

Comments
 (0)