From b28bffa15ddc5dcf13047e2f32f160bebf7bb4cb Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 14 Mar 2017 16:35:20 +1100 Subject: [PATCH] pubsub: make Publisher log less chatty Fixes #1681. --- .../java/com/google/cloud/pubsub/spi/v1/Publisher.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java index cb230263f980..a4c47aa9fa2e 100644 --- a/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java +++ b/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/spi/v1/Publisher.java @@ -236,7 +236,7 @@ && hasBundlingBytes() if (!messagesBundle.isEmpty()) { setupDurationBasedPublishAlarm(); } else if (currentAlarmFuture != null) { - logger.log(Level.INFO, "Cancelling alarm"); + logger.log(Level.FINER, "Cancelling alarm, no more messages"); if (activeAlarm.getAndSet(false)) { currentAlarmFuture.cancel(false); } @@ -248,7 +248,7 @@ && hasBundlingBytes() messagesWaiter.incrementPendingMessages(1); if (bundleToSend != null) { - logger.log(Level.INFO, "Scheduling a bundle for immediate sending."); + logger.log(Level.FINER, "Scheduling a bundle for immediate sending."); final OutstandingBundle finalBundleToSend = bundleToSend; executor.execute( new Runnable() { @@ -263,7 +263,7 @@ public void run() { // be sent in its own bundle immediately. if (hasBundlingBytes() && messageSize >= getMaxBundleBytes()) { logger.log( - Level.INFO, "Message exceeds the max bundle bytes, scheduling it for immediate send."); + Level.FINER, "Message exceeds the max bundle bytes, scheduling it for immediate send."); executor.execute( new Runnable() { @Override @@ -280,13 +280,13 @@ public void run() { private void setupDurationBasedPublishAlarm() { if (!activeAlarm.getAndSet(true)) { long delayThresholdMs = getBundlingSettings().getDelayThreshold().getMillis(); - logger.log(Level.INFO, "Setting up alarm for the next {0} ms.", delayThresholdMs); + logger.log(Level.FINER, "Setting up alarm for the next {0} ms.", delayThresholdMs); currentAlarmFuture = executor.schedule( new Runnable() { @Override public void run() { - logger.log(Level.INFO, "Sending messages based on schedule."); + logger.log(Level.FINER, "Sending messages based on schedule."); activeAlarm.getAndSet(false); publishAllOutstanding(); }