|
60 | 60 | __all__ = ['PortableRunner'] |
61 | 61 |
|
62 | 62 | MESSAGE_LOG_LEVELS = { |
63 | | - beam_job_api_pb2.JobMessage.MESSAGE_IMPORTANCE_UNSPECIFIED: logging.WARNING, |
64 | | - beam_job_api_pb2.JobMessage.JOB_MESSAGE_DEBUG: logging.WARNING, |
65 | | - beam_job_api_pb2.JobMessage.JOB_MESSAGE_DETAILED: logging.WARNING, |
66 | | - beam_job_api_pb2.JobMessage.JOB_MESSAGE_BASIC: logging.WARNING, |
| 63 | + beam_job_api_pb2.JobMessage.MESSAGE_IMPORTANCE_UNSPECIFIED: logging.INFO, |
| 64 | + beam_job_api_pb2.JobMessage.JOB_MESSAGE_DEBUG: logging.DEBUG, |
| 65 | + beam_job_api_pb2.JobMessage.JOB_MESSAGE_DETAILED: logging.DEBUG, |
| 66 | + beam_job_api_pb2.JobMessage.JOB_MESSAGE_BASIC: logging.INFO, |
67 | 67 | beam_job_api_pb2.JobMessage.JOB_MESSAGE_WARNING: logging.WARNING, |
68 | 68 | beam_job_api_pb2.JobMessage.JOB_MESSAGE_ERROR: logging.ERROR, |
69 | 69 | } |
@@ -158,7 +158,7 @@ def add_runner_options(parser): |
158 | 158 | # only in this case is duplicate not treated as error |
159 | 159 | if 'conflicting option string' not in str(e): |
160 | 160 | raise |
161 | | - _LOGGER.warning("Runner option '%s' was already added" % option.name) |
| 161 | + _LOGGER.debug("Runner option '%s' was already added" % option.name) |
162 | 162 |
|
163 | 163 | all_options = self.options.get_all_options( |
164 | 164 | add_extra_args_fn=add_runner_options, |
@@ -384,7 +384,7 @@ def run_portable_pipeline( |
384 | 384 | if cleanup_callbacks: |
385 | 385 | # Register an exit handler to ensure cleanup on exit. |
386 | 386 | atexit.register(functools.partial(result._cleanup, on_exit=True)) |
387 | | - _LOGGER.warning( |
| 387 | + _LOGGER.info( |
388 | 388 | 'Environment "%s" has started a component necessary for the ' |
389 | 389 | 'execution. Be sure to run the pipeline using\n' |
390 | 390 | ' with Pipeline() as p:\n' |
@@ -532,11 +532,14 @@ def read_messages() -> None: |
532 | 532 | previous_state = -1 |
533 | 533 | for message in self._message_stream: |
534 | 534 | if message.HasField('message_response'): |
535 | | - logging.warning("%s", message.message_response.message_text) |
| 535 | + logging.log( |
| 536 | + MESSAGE_LOG_LEVELS[message.message_response.importance], |
| 537 | + "%s", |
| 538 | + message.message_response.message_text) |
536 | 539 | else: |
537 | 540 | current_state = message.state_response.state |
538 | 541 | if current_state != previous_state: |
539 | | - _LOGGER.warning( |
| 542 | + _LOGGER.info( |
540 | 543 | "Job state changed to %s", |
541 | 544 | self.runner_api_state_to_pipeline_state(current_state)) |
542 | 545 | previous_state = current_state |
@@ -586,7 +589,7 @@ def _observe_state(self, message_thread): |
586 | 589 |
|
587 | 590 | def _cleanup(self, on_exit: bool = False) -> None: |
588 | 591 | if on_exit and self._cleanup_callbacks: |
589 | | - _LOGGER.warning( |
| 592 | + _LOGGER.info( |
590 | 593 | 'Running cleanup on exit. If your pipeline should continue running, ' |
591 | 594 | 'be sure to use the following syntax:\n' |
592 | 595 | ' with Pipeline() as p:\n' |
|
0 commit comments