Skip to content

Commit

Permalink
Merge pull request #349 from scoheb/fix-logging
Browse files Browse the repository at this point in the history
[JENKINS-48622] reduce logging spam from GerritMissedEventsPlaybackEnabledChecker
  • Loading branch information
rsandell committed Feb 6, 2018
2 parents 752dcc8 + 5ce7de9 commit f6cdb2f
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 f6cdb2f

Please sign in to comment.