[Gradle, JS] Refactor check on error
#KT-38109 fixed
This commit is contained in:
+2
-2
@@ -48,8 +48,8 @@ class TeamCityMessageCommonClient(
|
|||||||
|
|
||||||
if (inStackTrace) return
|
if (inStackTrace) return
|
||||||
|
|
||||||
when (type) {
|
if (type?.isErrorLike() == true) {
|
||||||
LogType.ERROR, LogType.WARN -> errors.add(value.clearAnsiColor())
|
errors.add(value.clearAnsiColor())
|
||||||
}
|
}
|
||||||
|
|
||||||
type?.let { log.processLogMessage(value, it) }
|
type?.let { log.processLogMessage(value, it) }
|
||||||
|
|||||||
+4
@@ -66,6 +66,10 @@ enum class LogType(val value: String) {
|
|||||||
DEBUG("debug"),
|
DEBUG("debug"),
|
||||||
LOG("log");
|
LOG("log");
|
||||||
|
|
||||||
|
fun isErrorLike(): Boolean {
|
||||||
|
return this == ERROR || this == WARN
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun byValueOrNull(value: String?): LogType? {
|
fun byValueOrNull(value: String?): LogType? {
|
||||||
if (value == null) return null
|
if (value == null) return null
|
||||||
|
|||||||
+2
-4
@@ -451,10 +451,8 @@ class KotlinKarma(override val compilation: KotlinJsCompilation) :
|
|||||||
val actualText = if (launcherMessage != null) {
|
val actualText = if (launcherMessage != null) {
|
||||||
val (logLevel, message) = launcherMessage.destructured
|
val (logLevel, message) = launcherMessage.destructured
|
||||||
actualType = LogType.byValueOrNull(logLevel.toLowerCase())
|
actualType = LogType.byValueOrNull(logLevel.toLowerCase())
|
||||||
when (actualType) {
|
if (actualType?.isErrorLike() == true) {
|
||||||
LogType.WARN, LogType.ERROR -> {
|
processFailedBrowsers(text)
|
||||||
processFailedBrowsers(text)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
message
|
message
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user