Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pluginManagement {
}

/*
* Fail the build if any WARN/ERROR log events occur.
* Fail the build if any ERROR log events occur.
* Some projects forbid *any* build-time logging at these levels;
* this ensures Log4j upgrades don't get blocked by harmless noise.
*
Expand All @@ -33,7 +33,7 @@ import org.gradle.internal.logging.events.LogEvent
import org.gradle.internal.logging.LoggingManagerInternal
def events = []
def listener = { e ->
if (e instanceof LogEvent && e.logLevel.ordinal() >= LogLevel.WARN.ordinal()) {
if (e instanceof LogEvent && e.logLevel.ordinal() >= LogLevel.ERROR.ordinal()) {
events << e
}
}
Expand All @@ -49,9 +49,9 @@ gradle.settingsEvaluated {
gradle.buildFinished {
loggingManager.removeOutputEventListener(listener)
if (!events.isEmpty()) {
println "\n* Build failed due to ${events.size()} WARN/ERROR log event(s):"
println "\n* Build failed due to ${events.size()} ERROR log event(s):"
events.each { println "[${it.logLevel}] ${it.message}" }
throw new GradleException("Build aborted: disallowed WARN/ERROR log events detected.")
throw new GradleException("Build aborted: disallowed ERROR log events detected.")
}
}
}
Expand Down
Loading