Поэтому я хочу отключить ведение журнала для тестов JUnit.
Простейшим способом было бы переключить привязку с slf4j-simple
на slf4j-nop
.
Как мне это сделать, хотя?
Я пытался exclude
:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation "org.jetbrains.anko:anko-common:$anko_version"
implementation "org.slf4j:slf4j-simple:1.6.1"
testImplementation("org.slf4j:slf4j-nop:1.6.1"){
exclude(group:'org.slf4j', module:'slf4j-simple')
}
implementation 'io.github.microutils:kotlin-logging:1.6.10'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Но это все равно приводит к
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/user1291/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-nop/1.6.1/70249094d4e5653b6bdfea46f3a1a4165c1e1993/slf4j-nop-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/user1291/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.6.1/58e59bfb3e247097b8122243b3bfe0049c8cfae8/slf4j-simple-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
Также пытался configurations
:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation "org.jetbrains.anko:anko-common:$anko_version"
implementation "org.slf4j:slf4j-simple:1.6.1"
testImplementation "org.slf4j:slf4j-nop:1.6.1"
implementation 'io.github.microutils:kotlin-logging:1.6.10'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
configurations{
testImplementation.exclude(group:'org.slf4j',module:'slf4j-simple')
}
который не имел значения.