Skip to content

Commit 4446c32

Browse files
committed
[JENKINS-69613] Reduce log output at INFO level
Require a non-default logging level to see messages related to polling and indexing, including the "polling not triggered", "polling triggered", and "indexing triggered" messages. Only changes the logging level, not the availability of those log messages.
1 parent af5300b commit 4446c32

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/hudson/plugins/git/GitStatus.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ public List<ResponseContributor> onNotifyCommit(String origin, URIish uri, Strin
390390

391391
SCMTrigger trigger = scmTriggerItem.getSCMTrigger();
392392
if (trigger == null || trigger.isIgnorePostCommitHooks()) {
393-
LOGGER.log(Level.INFO, "no trigger, or post-commit hooks disabled, on {0}", project.getFullDisplayName());
393+
if (LOGGER.isLoggable(Level.FINE)) {
394+
LOGGER.log(Level.FINE, "no trigger, or post-commit hooks disabled, on {0}", project.getFullDisplayName());
395+
}
394396
continue;
395397
}
396398

@@ -456,7 +458,9 @@ public List<ResponseContributor> onNotifyCommit(String origin, URIish uri, Strin
456458
* NOTE: This is not scheduling the build, just polling for changes
457459
* If the polling detects changes, it will schedule the build
458460
*/
459-
LOGGER.log(Level.INFO, "Triggering the polling of {0}", project.getFullDisplayName());
461+
if (LOGGER.isLoggable(Level.FINE)) {
462+
LOGGER.log(Level.FINE, "Triggering the polling of {0}", project.getFullDisplayName());
463+
}
460464
trigger.run();
461465
result.add(new PollingScheduledResponseContributor(project));
462466
break SCMS; // no need to trigger the same project twice, so do not consider other GitSCMs in it

src/main/java/jenkins/plugins/git/GitSCMSource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ public boolean isMatch(@NonNull SCM scm) {
646646
continue;
647647
}
648648
if (GitStatus.looselyMatches(uri, remote)) {
649-
LOGGER.info("Triggering the indexing of " + owner.getFullDisplayName()
649+
LOGGER.fine("Triggering the indexing of " + owner.getFullDisplayName()
650650
+ " as a result of event from " + origin);
651651
triggerIndexing(owner, source);
652652
result.add(new GitStatus.ResponseContributor() {

0 commit comments

Comments
 (0)