|
20 | 20 | import enum
|
21 | 21 | import itertools
|
22 | 22 | import json
|
23 |
| -import logging |
24 | 23 | import math
|
25 | 24 | import time
|
26 | 25 | import warnings
|
|
37 | 36 | from kubernetes.stream import stream as kubernetes_stream
|
38 | 37 | from pendulum import DateTime
|
39 | 38 | from pendulum.parsing.exceptions import ParserError
|
40 |
| -from tenacity import before_log |
41 | 39 | from typing_extensions import Literal
|
42 | 40 | from urllib3.exceptions import HTTPError as BaseHTTPError
|
43 | 41 |
|
@@ -392,7 +390,6 @@ def fetch_container_logs(
|
392 | 390 | retry=tenacity.retry_if_exception_type(ApiException),
|
393 | 391 | stop=tenacity.stop_after_attempt(10),
|
394 | 392 | wait=tenacity.wait_fixed(1),
|
395 |
| - before=before_log(self.log, logging.INFO), |
396 | 393 | )
|
397 | 394 | def consume_logs(
|
398 | 395 | *,
|
@@ -452,17 +449,10 @@ def consume_logs(
|
452 | 449 | self._progress_callback(line)
|
453 | 450 | self.log.info("[%s] %s", container_name, message_to_log)
|
454 | 451 | last_captured_timestamp = message_timestamp
|
455 |
| - except BaseHTTPError as e: |
456 |
| - self.log.warning( |
457 |
| - "Reading of logs interrupted for container %r with error %r; will retry. " |
458 |
| - "Set log level to DEBUG for traceback.", |
| 452 | + except BaseHTTPError: |
| 453 | + self.log.exception( |
| 454 | + "Reading of logs interrupted for container %r; will retry.", |
459 | 455 | container_name,
|
460 |
| - e, |
461 |
| - ) |
462 |
| - self.log.debug( |
463 |
| - "Traceback for interrupted logs read for pod %r", |
464 |
| - pod.metadata.name, |
465 |
| - exc_info=True, |
466 | 456 | )
|
467 | 457 | return last_captured_timestamp or since_time, logs
|
468 | 458 |
|
|
0 commit comments