Skip to content

Logging is too chatty at WARN level #160

@nikita2206

Description

@nikita2206

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions