diff --git a/enforcer-api/pom.xml b/enforcer-api/pom.xml index b6dc3573..55a9bd5f 100644 --- a/enforcer-api/pom.xml +++ b/enforcer-api/pom.xml @@ -24,7 +24,7 @@ org.apache.maven.enforcer enforcer - 3.3.1-SNAPSHOT + 3.4.0-SNAPSHOT enforcer-api diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLogger.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLogger.java index 1c156d21..b847e441 100644 --- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLogger.java +++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLogger.java @@ -44,6 +44,14 @@ public interface EnforcerLogger { */ void warnOrError(Supplier messageSupplier); + /** + * Is the logger instance enabled for the DEBUG level? + * + * @return {@code true} if this Logger is enabled for the DEBUG level, {@code false} otherwise. + * @since 3.4.0 + */ + boolean isDebugEnabled(); + /** * Log message in {@code debug} level. * @@ -60,6 +68,14 @@ public interface EnforcerLogger { */ void debug(Supplier messageSupplier); + /** + * Is the logger instance enabled for the INFO level? + * + * @return {@code true} if this Logger is enabled for the INFO level, {@code false} otherwise. + * @since 3.4.0 + */ + boolean isInfoEnabled(); + /** * Log message in {@code info} level. * @@ -76,6 +92,14 @@ public interface EnforcerLogger { */ void info(Supplier messageSupplier); + /** + * Is the logger instance enabled for the WARN level? + * + * @return {@code true} if this Logger is enabled for the WARN level, {@code false} otherwise. + * @since 3.4.0 + */ + boolean isWarnEnabled(); + /** * Log message in {@code warn} level. * @@ -92,6 +116,14 @@ public interface EnforcerLogger { */ void warn(Supplier messageSupplier); + /** + * Is the logger instance enabled for the ERROR level? + * + * @return {@code true} if this Logger is enabled for the ERROR level, {@code false} otherwise. + * @since 3.4.0 + */ + boolean isErrorEnabled(); + /** * Log message in {@code error} level. * diff --git a/enforcer-rules/pom.xml b/enforcer-rules/pom.xml index 0bad8094..82a6349d 100644 --- a/enforcer-rules/pom.xml +++ b/enforcer-rules/pom.xml @@ -24,7 +24,7 @@ org.apache.maven.enforcer enforcer - 3.3.1-SNAPSHOT + 3.4.0-SNAPSHOT enforcer-rules diff --git a/maven-enforcer-extension/pom.xml b/maven-enforcer-extension/pom.xml index 0895add4..07cc0bf7 100644 --- a/maven-enforcer-extension/pom.xml +++ b/maven-enforcer-extension/pom.xml @@ -23,7 +23,7 @@ org.apache.maven.enforcer enforcer - 3.3.1-SNAPSHOT + 3.4.0-SNAPSHOT org.apache.maven.extensions maven-enforcer-extension diff --git a/maven-enforcer-plugin/pom.xml b/maven-enforcer-plugin/pom.xml index d6223f61..2db38f86 100644 --- a/maven-enforcer-plugin/pom.xml +++ b/maven-enforcer-plugin/pom.xml @@ -24,7 +24,7 @@ org.apache.maven.enforcer enforcer - 3.3.1-SNAPSHOT + 3.4.0-SNAPSHOT org.apache.maven.plugins diff --git a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/internal/AbstractEnforcerLogger.java b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/internal/AbstractEnforcerLogger.java index bfd0920f..6d32d028 100644 --- a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/internal/AbstractEnforcerLogger.java +++ b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/internal/AbstractEnforcerLogger.java @@ -38,6 +38,11 @@ protected AbstractEnforcerLogger(Log log) { this.log = Objects.requireNonNull(log, "log must be not null"); } + @Override + public boolean isDebugEnabled() { + return log.isDebugEnabled(); + } + @Override public void debug(CharSequence message) { log.debug(message); @@ -50,6 +55,11 @@ public void debug(Supplier messageSupplier) { } } + @Override + public boolean isInfoEnabled() { + return log.isInfoEnabled(); + } + @Override public void info(CharSequence message) { log.info(message); @@ -62,6 +72,11 @@ public void info(Supplier messageSupplier) { } } + @Override + public boolean isWarnEnabled() { + return log.isWarnEnabled(); + } + @Override public void warn(CharSequence message) { log.warn(message); @@ -74,6 +89,11 @@ public void warn(Supplier messageSupplier) { } } + @Override + public boolean isErrorEnabled() { + return log.isErrorEnabled(); + } + @Override public void error(CharSequence message) { log.error(message); diff --git a/pom.xml b/pom.xml index 59d3e50c..ed1a9061 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ org.apache.maven.enforcer enforcer - 3.3.1-SNAPSHOT + 3.4.0-SNAPSHOT pom Apache Maven Enforcer @@ -81,7 +81,7 @@ enforcer-archives/enforcer-LATEST 8 4.11.0 - 2023-04-01T21:03:41Z + 2023-07-04T18:27:24Z 1.0.0.v20140518