This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j-samples.git


The following commit(s) were added to refs/heads/main by this push:
     new 2f5aa3d  Pull Gradle's unexpected log event failures threshold from 
WARN to ERROR (#371)
2f5aa3d is described below

commit 2f5aa3d954b93f09738b843ec1c05d4c868a49d1
Author: Volkan Yazıcı <[email protected]>
AuthorDate: Thu Sep 18 20:17:27 2025 +0200

    Pull Gradle's unexpected log event failures threshold from WARN to ERROR 
(#371)
---
 settings.gradle | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/settings.gradle b/settings.gradle
index 6f7ec66..40b922c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -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.
  *
@@ -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
     }
 }
@@ -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.")
         }
     }
 }

Reply via email to