Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-48622] reduce logging spam from GerritMissedEventsPlaybackEn…
…abledChecker
  • Loading branch information
scoheb committed Feb 5, 2018
1 parent 752dcc8 commit 5ce7de9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Expand Up @@ -35,6 +35,7 @@
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;


/**
Expand All @@ -51,6 +52,15 @@ public class GerritMissedEventsPlaybackEnabledChecker extends AsyncPeriodicWork
LoggerFactory.getLogger(GerritMissedEventsPlaybackEnabledChecker.class);


/**
* No spam in log file.
* @return FINEST level for logging.
*/
@Override
protected Level getNormalLoggingLevel() {
return Level.FINEST;
}

/**
* Default constructor.
*/
Expand Down
Expand Up @@ -61,7 +61,7 @@ private static String buildURL(IGerritHudsonTriggerConfig config) {
}

if (!config.isUseRestApi()) {
logger.warn("REST API is not enabled.");
logger.debug("REST API is not enabled.");
return null;
}

Expand Down Expand Up @@ -150,7 +150,11 @@ public static boolean isPluginEnabled(IGerritHudsonTriggerConfig config, String

String restUrl = buildURL(config);
if (restUrl == null) {
logger.warn(Messages.PluginInstalledRESTApiNull(pluginName));
if (quiet) {
logger.debug(Messages.PluginInstalledRESTApiNull(pluginName));
} else {
logger.warn(Messages.PluginInstalledRESTApiNull(pluginName));
}
return false;
}
logger.trace("{}plugins/{}/", restUrl, pluginName);
Expand Down

0 comments on commit 5ce7de9

Please sign in to comment.