Skip to content

Commit

Permalink
Merge pull request #842 from ron190/add-quiet-parameter
Browse files Browse the repository at this point in the history
Disable logging bugs when quiet param is active
  • Loading branch information
hazendaz authored Jul 12, 2024
2 parents e8bc3be + f2daa59 commit 74d8e91
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,13 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
* @since 2.4.1
*/
@Parameter(property = "spotbugs.maxAllowedViolations", defaultValue = "0")
int maxAllowedViolations
int maxAllowedViolations

/**
* Disable bugs log.
*/
@Parameter(defaultValue = "false", property = "spotbugs.quiet")
boolean quiet

@Override
void execute() {
Expand Down Expand Up @@ -488,8 +494,10 @@ abstract class BaseViolationCheckMojo extends AbstractMojo {
// lower is more severe
if (priorityNum <= priorityThresholdNum) {
bugCountAboveThreshold += 1
log.error(logMsg)
} else {
if (!quiet) {
log.error(logMsg)
}
} else if (!quiet) {
log.info(logMsg)
}
}
Expand Down

0 comments on commit 74d8e91

Please sign in to comment.