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 · 0 comments
Open

Logging is too chatty at WARN level #160

nikita2206 opened this issue Jan 4, 2023 · 0 comments

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.

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

No branches or pull requests

1 participant