|
90 | 90 | if TYPE_CHECKING: |
91 | 91 | from apache_beam.runners.pipeline_context import PipelineContext |
92 | 92 |
|
| 93 | +_LOGGER = logging.getLogger(__name__) |
| 94 | + |
93 | 95 | __all__ = [ |
94 | 96 | 'BatchElements', |
95 | 97 | 'CoGroupByKey', |
@@ -499,7 +501,7 @@ def get_secret_bytes(self) -> bytes: |
499 | 501 | request={"name": secret_version_path}) |
500 | 502 | return response.payload.data |
501 | 503 | except api_exceptions.NotFound: |
502 | | - logging.info( |
| 504 | + _LOGGER.info( |
503 | 505 | "Secret version %s not found. " |
504 | 506 | "Creating new secret and version.", |
505 | 507 | secret_version_path) |
@@ -704,7 +706,7 @@ def expand(self, pcoll): |
704 | 706 | try: |
705 | 707 | coder = coder.as_deterministic_coder(self.label) |
706 | 708 | except ValueError: |
707 | | - logging.warning( |
| 709 | + _LOGGER.warning( |
708 | 710 | 'GroupByEncryptedKey %s: ' |
709 | 711 | 'The key coder is not deterministic. This may result in incorrect ' |
710 | 712 | 'pipeline output. This can be fixed by adding a type hint to the ' |
@@ -1025,7 +1027,7 @@ def finish_bundle(self): |
1025 | 1027 | self._batch = None |
1026 | 1028 | self._running_batch_size = 0 |
1027 | 1029 | self._target_batch_size = self._batch_size_estimator.next_batch_size() |
1028 | | - logging.info( |
| 1030 | + _LOGGER.info( |
1029 | 1031 | "BatchElements statistics: " + self._batch_size_estimator.stats()) |
1030 | 1032 |
|
1031 | 1033 |
|
@@ -1957,15 +1959,15 @@ def process( |
1957 | 1959 | log_line += ', pane_info=' + repr(pane_info) |
1958 | 1960 |
|
1959 | 1961 | if self.level == logging.DEBUG: |
1960 | | - logging.debug(log_line) |
| 1962 | + _LOGGER.debug(log_line) |
1961 | 1963 | elif self.level == logging.INFO: |
1962 | | - logging.info(log_line) |
| 1964 | + _LOGGER.info(log_line) |
1963 | 1965 | elif self.level == logging.WARNING: |
1964 | | - logging.warning(log_line) |
| 1966 | + _LOGGER.warning(log_line) |
1965 | 1967 | elif self.level == logging.ERROR: |
1966 | | - logging.error(log_line) |
| 1968 | + _LOGGER.error(log_line) |
1967 | 1969 | elif self.level == logging.CRITICAL: |
1968 | | - logging.critical(log_line) |
| 1970 | + _LOGGER.critical(log_line) |
1969 | 1971 | else: |
1970 | 1972 | print(log_line) |
1971 | 1973 |
|
|
0 commit comments