|
60 | 60 | __all__ = ['PortableRunner'] |
61 | 61 |
|
62 | 62 | MESSAGE_LOG_LEVELS = { |
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, |
| 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, |
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.debug("Runner option '%s' was already added" % option.name) |
| 161 | + _LOGGER.warning("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.info( |
| 387 | + _LOGGER.warning( |
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,14 +532,12 @@ 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.log( |
536 | | - MESSAGE_LOG_LEVELS[message.message_response.importance], |
| 535 | + logging.warning( |
537 | 536 | "%s", |
538 | 537 | message.message_response.message_text) |
539 | 538 | else: |
540 | 539 | current_state = message.state_response.state |
541 | 540 | if current_state != previous_state: |
542 | | - # TODO - change back to original logging |
543 | 541 | _LOGGER.warning( |
544 | 542 | "Job state changed to %s", |
545 | 543 | self.runner_api_state_to_pipeline_state(current_state)) |
@@ -590,7 +588,7 @@ def _observe_state(self, message_thread): |
590 | 588 |
|
591 | 589 | def _cleanup(self, on_exit: bool = False) -> None: |
592 | 590 | if on_exit and self._cleanup_callbacks: |
593 | | - _LOGGER.info( |
| 591 | + _LOGGER.warning( |
594 | 592 | 'Running cleanup on exit. If your pipeline should continue running, ' |
595 | 593 | 'be sure to use the following syntax:\n' |
596 | 594 | ' with Pipeline() as p:\n' |
|
0 commit comments