Skip to content

Commit

Permalink
Replaced log4j with slf4j + log4j implementation
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
dievsky committed Dec 4, 2019
1 parent 8263322 commit 9daf1c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,15 @@ dependencies {
compile 'org.apache.commons:commons-math3:3.6'
compile "org.jetbrains.bio:npy:0.3.3"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
jmhCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'log4j:log4j:1.2.17'
jmhCompile 'log4j:log4j:1.2.17'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'

testCompile "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testCompile 'junit:junit:4.12'
testCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'

jmh files("$rootDir/libs/yeppp-bundle-1.0.jar")
jmhCompile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
jmhCompile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}

dokka {
Expand Down
13 changes: 5 additions & 8 deletions src/main/kotlin/org/jetbrains/bio/viktor/Loader.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package org.jetbrains.bio.viktor

import org.apache.log4j.ConsoleAppender
import org.apache.log4j.Logger
import org.apache.log4j.SimpleLayout
import org.slf4j.LoggerFactory
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.StandardCopyOption.REPLACE_EXISTING
Expand Down Expand Up @@ -34,7 +32,7 @@ internal class ResourceLibrary(private val name: String) {

internal object Loader {

private val LOG = Logger.getLogger(Loader::class.java)
private val LOG = LoggerFactory.getLogger(Loader::class.java)

/** If `true` vector operations will be SIMD-optimized. */
internal var nativeLibraryLoaded: Boolean = false
Expand All @@ -54,7 +52,6 @@ internal object Loader {
}

init {
LOG.addAppender(ConsoleAppender(SimpleLayout()))

try {
architectureSupported = arch.let { true }
Expand All @@ -80,14 +77,14 @@ internal object Loader {

private fun warnNoOptimization() {
if (!architectureSupported) {
LOG.info("SIMD optimization is not available for your architecture, use --debug for details.")
LOG.info("SIMD optimization is not available for your architecture, enable debug output for more details.")
LOG.debug(
"""Currently supported architectures: x86_64, amd64.
Fallback Kotlin implementation will be used.
Build viktor for your system from source as described in https://github.com/JetBrains-Research/viktor"""
)
} else if (!nativeLibraryLoaded) {
LOG.info("Couldn't load native SIMD library, use --debug for details.")
LOG.info("Couldn't load native SIMD library, enable debug output for more details.")
LOG.debug(
"""Native SIMD library couldn't be loaded.
Currently supported operational systems: Linux, Windows, MacOS.
Expand All @@ -96,7 +93,7 @@ Build viktor for your system from source as described in https://github.com/JetB
)
}
else if (!optimizationSupported) {
LOG.info("SIMD optimization is not available for your system, use --debug for details.")
LOG.info("SIMD optimization is not available for your system, enable debug output for more details.")
LOG.debug(
"""No supported SIMD instruction sets were detected on your system.
Currently supported SIMD instruction sets: SSE2, AVX.
Expand Down

0 comments on commit 9daf1c0

Please sign in to comment.