Improve daemon client debug reports
Before this change a daemon client debug messages were printed only when the client could not connect and the 'kotlin.daemon.verbose' system property was set up. Now messages are printed if the debug logging is enabled and the 'kotlin.daemon.verbose' is set up.
This commit is contained in:
+7
-1
@@ -42,6 +42,8 @@ interface KotlinLogger {
|
||||
fun warn(msg: String)
|
||||
fun info(msg: String)
|
||||
fun debug(msg: String)
|
||||
|
||||
val isDebugEnabled: Boolean
|
||||
}
|
||||
|
||||
abstract class KotlinCompilerRunner<in Env : CompilerEnvironment> {
|
||||
@@ -61,11 +63,15 @@ abstract class KotlinCompilerRunner<in Env : CompilerEnvironment> {
|
||||
val daemonJVMOptions = configureDaemonJVMOptions(inheritMemoryLimits = true, inheritAdditionalProperties = true)
|
||||
|
||||
val daemonReportMessages = ArrayList<DaemonReportMessage>()
|
||||
val daemonReportingTargets = when {
|
||||
log.isDebugEnabled -> DaemonReportingTargets(messages = daemonReportMessages)
|
||||
else -> DaemonReportingTargets(messageCollector = environment.messageCollector)
|
||||
}
|
||||
|
||||
val profiler = if (daemonOptions.reportPerf) WallAndThreadAndMemoryTotalProfiler(withGC = false) else DummyProfiler()
|
||||
|
||||
val connection = profiler.withMeasure(null) {
|
||||
val daemon = KotlinCompilerClient.connectToCompileService(compilerId, daemonJVMOptions, daemonOptions, DaemonReportingTargets(null, daemonReportMessages), true, true)
|
||||
val daemon = KotlinCompilerClient.connectToCompileService(compilerId, daemonJVMOptions, daemonOptions, daemonReportingTargets, true, true)
|
||||
DaemonConnection(daemon, daemon?.leaseCompileSession(flagFile.absolutePath)?.get() ?: CompileService.NO_SESSION)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user