Fix printing daemon client messages
Fixing the problem introduced in the commit 9819de1abd:
the daemon client messages should be reported
when the debug log level is enabled
or when the connection not successful
#KT-17199 fixed
This commit is contained in:
+10
-8
@@ -68,10 +68,7 @@ abstract class KotlinCompilerRunner<in Env : CompilerEnvironment> {
|
|||||||
val daemonJVMOptions = configureDaemonJVMOptions(inheritMemoryLimits = true, inheritAdditionalProperties = true)
|
val daemonJVMOptions = configureDaemonJVMOptions(inheritMemoryLimits = true, inheritAdditionalProperties = true)
|
||||||
|
|
||||||
val daemonReportMessages = ArrayList<DaemonReportMessage>()
|
val daemonReportMessages = ArrayList<DaemonReportMessage>()
|
||||||
val daemonReportingTargets = when {
|
val daemonReportingTargets = DaemonReportingTargets(messages = daemonReportMessages)
|
||||||
log.isDebugEnabled -> DaemonReportingTargets(messages = daemonReportMessages)
|
|
||||||
else -> DaemonReportingTargets(messageCollector = environment.messageCollector)
|
|
||||||
}
|
|
||||||
|
|
||||||
val profiler = if (daemonOptions.reportPerf) WallAndThreadAndMemoryTotalProfiler(withGC = false) else DummyProfiler()
|
val profiler = if (daemonOptions.reportPerf) WallAndThreadAndMemoryTotalProfiler(withGC = false) else DummyProfiler()
|
||||||
|
|
||||||
@@ -86,10 +83,15 @@ abstract class KotlinCompilerRunner<in Env : CompilerEnvironment> {
|
|||||||
sessionAliveFlagFile = sessionAliveFlagFile)
|
sessionAliveFlagFile = sessionAliveFlagFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (msg in daemonReportMessages) {
|
if (connection == null || log.isDebugEnabled) {
|
||||||
environment.messageCollector.report(CompilerMessageSeverity.INFO,
|
for (message in daemonReportMessages) {
|
||||||
(if (msg.category == DaemonReportCategory.EXCEPTION && connection == null) "Falling back to compilation without daemon due to error: " else "") + msg.message,
|
val severity = when(message.category) {
|
||||||
CompilerMessageLocation.NO_LOCATION)
|
DaemonReportCategory.DEBUG -> CompilerMessageSeverity.INFO
|
||||||
|
DaemonReportCategory.INFO -> CompilerMessageSeverity.INFO
|
||||||
|
DaemonReportCategory.EXCEPTION -> CompilerMessageSeverity.EXCEPTION
|
||||||
|
}
|
||||||
|
environment.messageCollector.report(severity, message.message, CompilerMessageLocation.NO_LOCATION)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun reportTotalAndThreadPerf(message: String, daemonOptions: DaemonOptions, messageCollector: MessageCollector, profiler: Profiler) {
|
fun reportTotalAndThreadPerf(message: String, daemonOptions: DaemonOptions, messageCollector: MessageCollector, profiler: Profiler) {
|
||||||
|
|||||||
Reference in New Issue
Block a user