Skip to content

Commit 2f5aa3d

Browse files
authored
Pull Gradle's unexpected log event failures threshold from WARN to ERROR (#371)
1 parent 7427b24 commit 2f5aa3d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

settings.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pluginManagement {
2323
}
2424

2525
/*
26-
* Fail the build if any WARN/ERROR log events occur.
26+
* Fail the build if any ERROR log events occur.
2727
* Some projects forbid *any* build-time logging at these levels;
2828
* this ensures Log4j upgrades don't get blocked by harmless noise.
2929
*
@@ -33,7 +33,7 @@ import org.gradle.internal.logging.events.LogEvent
3333
import org.gradle.internal.logging.LoggingManagerInternal
3434
def events = []
3535
def listener = { e ->
36-
if (e instanceof LogEvent && e.logLevel.ordinal() >= LogLevel.WARN.ordinal()) {
36+
if (e instanceof LogEvent && e.logLevel.ordinal() >= LogLevel.ERROR.ordinal()) {
3737
events << e
3838
}
3939
}
@@ -49,9 +49,9 @@ gradle.settingsEvaluated {
4949
gradle.buildFinished {
5050
loggingManager.removeOutputEventListener(listener)
5151
if (!events.isEmpty()) {
52-
println "\n* Build failed due to ${events.size()} WARN/ERROR log event(s):"
52+
println "\n* Build failed due to ${events.size()} ERROR log event(s):"
5353
events.each { println "[${it.logLevel}] ${it.message}" }
54-
throw new GradleException("Build aborted: disallowed WARN/ERROR log events detected.")
54+
throw new GradleException("Build aborted: disallowed ERROR log events detected.")
5555
}
5656
}
5757
}

0 commit comments

Comments
 (0)