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

Logging is too chatty at WARN level #160

Open
nikita2206 opened this issue Jan 4, 2023 · 1 comment · Fixed by cgoeller/fmt-maven-plugin#1
Open

Logging is too chatty at WARN level #160

nikita2206 opened this issue Jan 4, 2023 · 1 comment · Fixed by cgoeller/fmt-maven-plugin#1

Comments

@nikita2206
Copy link

Describe the bug
We're currently getting a WARN-level log line when one of the Maven modules doesn't have a tests directory.

The code responsible for this:

if (testSourceDirectory.exists() && !skipTestSourceDirectory) {
directoriesToFormat.add(testSourceDirectory);
} else {
handleMissingDirectory("Test source", testSourceDirectory);
}

private void handleMissingDirectory(String directoryDisplayName, File directory)
throws MojoFailureException {
if (failOnUnknownFolder) {
String message =
directoryDisplayName
+ " directory '"
+ directory
+ "' does not exist, failing build (failOnUnknownFolder is true).";
getLog().error(message);
throw new MojoFailureException(message);
} else {
getLog()
.warn(directoryDisplayName + " directory '" + directory + "' does not exist, ignoring.");
}
}

It looks like it will WARN you of a missing directory even if you explicitly excluded that directory from being checked (even if it does in fact exist).

To me it feels like this is the kind of information that deserves to be logged but at a INFO level, otherwise it leads to 'warning fatigue' because most of the time this isn't something that people will act on and it's also not possible to disable.

cgoeller added a commit to cgoeller/fmt-maven-plugin that referenced this issue Oct 28, 2024
This should fix spotify#160 "Logging is too chatty at WARN level"
@rschuerer-realnetworks
Copy link

And even worse: When using skipTestSourceDirectory=true, the plugin shows the same warning about a missing directory.

If skipTestSourceDirectory or skipSourceDirectory are set explicitly, then no message should be shown at all about a missing directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants