Logging
This commit is contained in:
parent
b5f68a6274
commit
087123febf
@ -3,6 +3,7 @@ package no.iktdev.streamit.content.common.deamon
|
|||||||
import com.github.pgreze.process.ProcessResult
|
import com.github.pgreze.process.ProcessResult
|
||||||
import com.github.pgreze.process.Redirect
|
import com.github.pgreze.process.Redirect
|
||||||
import com.github.pgreze.process.process
|
import com.github.pgreze.process.process
|
||||||
|
import com.google.gson.Gson
|
||||||
import mu.KotlinLogging
|
import mu.KotlinLogging
|
||||||
|
|
||||||
private val logger = KotlinLogging.logger {}
|
private val logger = KotlinLogging.logger {}
|
||||||
@ -11,7 +12,7 @@ open class Daemon(open val executable: String, val daemonInterface: IDaemon) {
|
|||||||
var executor: ProcessResult? = null
|
var executor: ProcessResult? = null
|
||||||
open suspend fun run(parameters: List<String>): Int {
|
open suspend fun run(parameters: List<String>): Int {
|
||||||
daemonInterface.onStarted()
|
daemonInterface.onStarted()
|
||||||
logger.info { "Daemon arguments: $executable ${parameters.toTypedArray()}" }
|
logger.info { "Daemon arguments: $executable ${Gson().toJson(parameters.toTypedArray())}" }
|
||||||
executor = process(executable, *parameters.toTypedArray(),
|
executor = process(executable, *parameters.toTypedArray(),
|
||||||
stdout = Redirect.CAPTURE,
|
stdout = Redirect.CAPTURE,
|
||||||
stderr = Redirect.CAPTURE,
|
stderr = Redirect.CAPTURE,
|
||||||
|
|||||||
@ -64,6 +64,7 @@ class EncodeDaemon(val referenceId: String, val work: EncodeWork, val daemonInte
|
|||||||
override fun onOutputChanged(line: String) {
|
override fun onOutputChanged(line: String) {
|
||||||
super.onOutputChanged(line)
|
super.onOutputChanged(line)
|
||||||
outputCache.add(line)
|
outputCache.add(line)
|
||||||
|
logger.info { line }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user