Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MENFORCER-488] Add EnforcerLogger.is<Level>Enabled() #279

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion enforcer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
</parent>

<artifactId>enforcer-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ public interface EnforcerLogger {
*/
void warnOrError(Supplier<CharSequence> 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.
*
Expand Down
2 changes: 1 addition & 1 deletion enforcer-rules/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
</parent>

<artifactId>enforcer-rules</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-enforcer-extension/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.maven.extensions</groupId>
<artifactId>maven-enforcer-extension</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion maven-enforcer-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
</parent>

<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</parent>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer</artifactId>
<version>3.3.1-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Apache Maven Enforcer</name>
Expand Down Expand Up @@ -81,7 +81,7 @@
<maven.site.path>enforcer-archives/enforcer-LATEST</maven.site.path>
<javaVersion>8</javaVersion>
<mockito.version>4.11.0</mockito.version>
<project.build.outputTimestamp>2023-04-01T21:03:41Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2023-07-04T18:27:24Z</project.build.outputTimestamp>
<!-- the same as Maven 3.2.5 -->
<aether.version>1.0.0.v20140518</aether.version>

Expand Down