Removed kotlinLogging, and reverted to standard slf4j
This commit is contained in:
parent
15c4312d1e
commit
8ddb8d7738
|
@ -27,8 +27,8 @@ import dorkbox.executor.stream.IOStreamHandler
|
|||
import dorkbox.executor.stream.PumpStreamHandler
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import mu.KotlinLogging
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.slf4j.MDC
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
|
@ -79,7 +79,7 @@ class DeferredProcessResult internal constructor(private val process: Process,
|
|||
|
||||
companion object {
|
||||
private val EOL = "\n".toByteArray(UTF_8)
|
||||
private val log = KotlinLogging.logger {}
|
||||
private val log = LoggerFactory.getLogger(DeferredProcessResult::class.java)
|
||||
|
||||
/**
|
||||
* In case [InvalidExitValueException] is thrown and we have read the process output we include the output up to this length
|
||||
|
@ -386,9 +386,7 @@ class DeferredProcessResult internal constructor(private val process: Process,
|
|||
} catch (e: ExecutionException) {
|
||||
throw IllegalStateException("Could not close streams of $process", e.cause)
|
||||
} catch (e: TimeoutCancellationException) {
|
||||
log.warn {
|
||||
"Could not close streams of $process in ${params.closeTimeout} ${getUnitsAsString(params.closeTimeout, params.closeTimeoutUnit)}"
|
||||
}
|
||||
log.warn("Could not close streams of $process in ${params.closeTimeout} ${getUnitsAsString(params.closeTimeout, params.closeTimeoutUnit)}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@ import kotlinx.coroutines.CoroutineScope
|
|||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import mu.KotlinLogging
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.io.*
|
||||
|
@ -84,9 +83,9 @@ open class Executor {
|
|||
/**
|
||||
* Gets the version number.
|
||||
*/
|
||||
const val version = "3.1"
|
||||
const val version = "3.2"
|
||||
|
||||
val log = KotlinLogging.logger { }
|
||||
val log = LoggerFactory.getLogger(Executor::class.java)
|
||||
val IS_OS_WINDOWS: Boolean
|
||||
val IS_OS_MAC: Boolean
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ package dorkbox.executor
|
|||
import dorkbox.executor.exceptions.InvalidExitValueException
|
||||
import dorkbox.executor.processResults.SyncProcessResult
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import mu.KotlinLogging
|
||||
import org.slf4j.LoggerFactory
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.util.concurrent.TimeoutException
|
||||
|
@ -30,7 +30,7 @@ import java.util.concurrent.TimeoutException
|
|||
class JvmExecOptions(private val executor: Executor) {
|
||||
|
||||
companion object {
|
||||
private val log = KotlinLogging.logger { }
|
||||
private val log = LoggerFactory.getLogger(JvmExecOptions::class.java)
|
||||
|
||||
private val SPACE_REGEX = " ".toRegex()
|
||||
|
||||
|
@ -105,7 +105,7 @@ class JvmExecOptions(private val executor: Executor) {
|
|||
File("java")
|
||||
}
|
||||
|
||||
log.error { "Unable to find JVM executable [java.home=" + System.getProperty("java.home") + "]! Using '$jvmExecutable' as the default" }
|
||||
log.error("Unable to find JVM executable [java.home=" + System.getProperty("java.home") + "]! Using '$jvmExecutable' as the default")
|
||||
}
|
||||
|
||||
return jvmExecutable!!
|
||||
|
@ -150,7 +150,7 @@ class JvmExecOptions(private val executor: Executor) {
|
|||
|
||||
count++
|
||||
} catch (e: Exception) {
|
||||
log.error(e) { "Error processing classpath!!" }
|
||||
log.error("Error processing classpath!!", e)
|
||||
}
|
||||
|
||||
if (count < totalSize) {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
package dorkbox.executor
|
||||
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.helpers.MarkerIgnoringBase
|
||||
|
||||
object LogHelper {
|
||||
fun fixSshLogger(log: Logger?) {
|
||||
|
@ -106,7 +105,7 @@ object LogHelper {
|
|||
*
|
||||
* This is NOT to be used for performant critical logs!
|
||||
*/
|
||||
open class LogHelperLogger(name: String) : MarkerIgnoringBase() {
|
||||
open class LogHelperLogger(name: String) : org.slf4j.helpers.MarkerIgnoringBase() {
|
||||
val logger = org.slf4j.LoggerFactory.getLogger(name)!!
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
package dorkbox.executor.listener
|
||||
|
||||
import mu.KotlinLogging
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
||||
* Destroys all registered Processes when the VM exits.
|
||||
|
@ -57,7 +57,7 @@ import mu.KotlinLogging
|
|||
*/
|
||||
class ShutdownHookProcessDestroyer : ProcessDestroyer, Runnable {
|
||||
companion object {
|
||||
private val log = KotlinLogging.logger{}
|
||||
private val log = LoggerFactory.getLogger(ShutdownHookProcessDestroyer::class.java)
|
||||
|
||||
/**
|
||||
* Singleton instance of the [ShutdownHookProcessDestroyer].
|
||||
|
|
|
@ -44,7 +44,7 @@ import dorkbox.executor.Executor
|
|||
import dorkbox.executor.stream.nopStreams.NopInputStream
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.channels.Channel
|
||||
import mu.KotlinLogging
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.slf4j.MDC
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
|
@ -114,7 +114,7 @@ class PumpStreamHandler(out: OutputStream = System.out,
|
|||
asyncSupport: Boolean = false) : IOStreamHandler(out, err, input, asyncSupport) {
|
||||
|
||||
companion object {
|
||||
private val log = KotlinLogging.logger {}
|
||||
private val log = LoggerFactory.getLogger(PumpStreamHandler::class.java)
|
||||
|
||||
/**
|
||||
* the default size of the internal buffer for copying the streams
|
||||
|
@ -545,9 +545,7 @@ class PumpStreamHandler(out: OutputStream = System.out,
|
|||
* So since Java 8 after UNIXProcess detects the exit and there's something in the output buffer closing this stream throws IOException
|
||||
* with message "Stream closed" from NullOutputStream.
|
||||
*/
|
||||
log.trace(e) {
|
||||
"Failed to close process output stream:"
|
||||
}
|
||||
log.trace("Failed to close process output stream", e)
|
||||
}
|
||||
else {
|
||||
caught = add(caught, e)
|
||||
|
|
Loading…
Reference in New Issue
Block a user