Skip to content

Commit 950fbce

Browse files
authored
fix: change info logs to debug (#693)
1 parent c4ee2a1 commit 950fbce

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

google/cloud/pubsub_v1/subscriber/_protocol/heartbeater.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def heartbeat(self) -> None:
4848
_LOGGER.debug("Sent heartbeat.")
4949
self._stop_event.wait(timeout=self._period)
5050

51-
_LOGGER.info("%s exiting.", _HEARTBEAT_WORKER_NAME)
51+
_LOGGER.debug("%s exiting.", _HEARTBEAT_WORKER_NAME)
5252

5353
def start(self) -> None:
5454
with self._operational_lock:

google/cloud/pubsub_v1/subscriber/_protocol/leaser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def maintain_leases(self) -> None:
212212
_LOGGER.debug("Snoozing lease management for %f seconds.", snooze)
213213
self._stop_event.wait(timeout=snooze)
214214

215-
_LOGGER.info("%s exiting.", _LEASE_WORKER_NAME)
215+
_LOGGER.debug("%s exiting.", _LEASE_WORKER_NAME)
216216

217217
def start(self) -> None:
218218
with self._operational_lock:

google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ def heartbeat(self) -> bool:
743743
request = gapic_types.StreamingPullRequest(
744744
stream_ack_deadline_seconds=self.ack_deadline
745745
)
746-
_LOGGER.info(
746+
_LOGGER.debug(
747747
"Sending new ack_deadline of %d seconds.", self.ack_deadline
748748
)
749749
else:
@@ -1081,9 +1081,9 @@ def _should_recover(self, exception: BaseException) -> bool:
10811081
# If this is in the list of idempotent exceptions, then we want to
10821082
# recover.
10831083
if isinstance(exception, _RETRYABLE_STREAM_ERRORS):
1084-
_LOGGER.info("Observed recoverable stream error %s", exception)
1084+
_LOGGER.debug("Observed recoverable stream error %s", exception)
10851085
return True
1086-
_LOGGER.info("Observed non-recoverable stream error %s", exception)
1086+
_LOGGER.debug("Observed non-recoverable stream error %s", exception)
10871087
return False
10881088

10891089
def _should_terminate(self, exception: BaseException) -> bool:
@@ -1101,9 +1101,9 @@ def _should_terminate(self, exception: BaseException) -> bool:
11011101
"""
11021102
exception = _wrap_as_exception(exception)
11031103
if isinstance(exception, _TERMINATING_STREAM_ERRORS):
1104-
_LOGGER.info("Observed terminating stream error %s", exception)
1104+
_LOGGER.debug("Observed terminating stream error %s", exception)
11051105
return True
1106-
_LOGGER.info("Observed non-terminating stream error %s", exception)
1106+
_LOGGER.debug("Observed non-terminating stream error %s", exception)
11071107
return False
11081108

11091109
def _on_rpc_done(self, future: Any) -> None:
@@ -1117,7 +1117,7 @@ def _on_rpc_done(self, future: Any) -> None:
11171117
with shutting everything down. This is to prevent blocking in the
11181118
background consumer and preventing it from being ``joined()``.
11191119
"""
1120-
_LOGGER.info("RPC termination has signaled streaming pull manager shutdown.")
1120+
_LOGGER.debug("RPC termination has signaled streaming pull manager shutdown.")
11211121
error = _wrap_as_exception(future)
11221122
thread = threading.Thread(
11231123
name=_RPC_ERROR_THREAD_NAME, target=self._shutdown, kwargs={"reason": error}

samples/snippets/subscriber.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,14 +771,14 @@ def synchronous_pull_with_lease_management(
771771
"ack_deadline_seconds": 15,
772772
}
773773
)
774-
logger.info(f"Reset ack deadline for {msg_data}.")
774+
logger.debug(f"Reset ack deadline for {msg_data}.")
775775

776776
# If the process is complete, acknowledge the message.
777777
else:
778778
subscriber.acknowledge(
779779
request={"subscription": subscription_path, "ack_ids": [ack_id]}
780780
)
781-
logger.info(f"Acknowledged {msg_data}.")
781+
logger.debug(f"Acknowledged {msg_data}.")
782782
processes.pop(process)
783783
print(
784784
f"Received and acknowledged {len(response.received_messages)} messages from {subscription_path}."

tests/unit/pubsub_v1/subscriber/test_leaser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def create_manager(flow_control=types.FlowControl()):
8989

9090

9191
def test_maintain_leases_inactive_manager(caplog):
92-
caplog.set_level(logging.INFO)
92+
caplog.set_level(logging.DEBUG)
9393
manager = create_manager()
9494
manager.is_active = False
9595

@@ -107,7 +107,7 @@ def test_maintain_leases_inactive_manager(caplog):
107107

108108

109109
def test_maintain_leases_stopped(caplog):
110-
caplog.set_level(logging.INFO)
110+
caplog.set_level(logging.DEBUG)
111111
manager = create_manager()
112112

113113
leaser_ = leaser.Leaser(manager)

tests/unit/pubsub_v1/subscriber/test_streaming_pull_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ def test_heartbeat_inactive():
10361036

10371037

10381038
def test_heartbeat_stream_ack_deadline_seconds(caplog):
1039-
caplog.set_level(logging.INFO)
1039+
caplog.set_level(logging.DEBUG)
10401040
manager = make_manager()
10411041
manager._rpc = mock.create_autospec(bidi.BidiRpc, instance=True)
10421042
manager._rpc.is_active = True

0 commit comments

Comments
 (0)