Skip to content

Commit

Permalink
Disable logging bugs when quiet param is active
Browse files Browse the repository at this point in the history
  • Loading branch information
ron190 authored Jul 10, 2024
1 parent e8bc3be commit f2daa59
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 f2daa59

Please sign in to comment.