Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f73418

Browse files
authored
Temporarily update logging
1 parent c0fc545 commit 3f73418

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

sdks/python/apache_beam/runners/portability/portable_runner.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@
6060
__all__ = ['PortableRunner']
6161

6262
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,
6767
beam_job_api_pb2.JobMessage.JOB_MESSAGE_WARNING: logging.WARNING,
6868
beam_job_api_pb2.JobMessage.JOB_MESSAGE_ERROR: logging.ERROR,
6969
}
@@ -158,7 +158,7 @@ def add_runner_options(parser):
158158
# only in this case is duplicate not treated as error
159159
if 'conflicting option string' not in str(e):
160160
raise
161-
_LOGGER.debug("Runner option '%s' was already added" % option.name)
161+
_LOGGER.warning("Runner option '%s' was already added" % option.name)
162162

163163
all_options = self.options.get_all_options(
164164
add_extra_args_fn=add_runner_options,
@@ -384,7 +384,7 @@ def run_portable_pipeline(
384384
if cleanup_callbacks:
385385
# Register an exit handler to ensure cleanup on exit.
386386
atexit.register(functools.partial(result._cleanup, on_exit=True))
387-
_LOGGER.info(
387+
_LOGGER.warning(
388388
'Environment "%s" has started a component necessary for the '
389389
'execution. Be sure to run the pipeline using\n'
390390
' with Pipeline() as p:\n'
@@ -532,14 +532,12 @@ def read_messages() -> None:
532532
previous_state = -1
533533
for message in self._message_stream:
534534
if message.HasField('message_response'):
535-
logging.log(
536-
MESSAGE_LOG_LEVELS[message.message_response.importance],
535+
logging.warning(
537536
"%s",
538537
message.message_response.message_text)
539538
else:
540539
current_state = message.state_response.state
541540
if current_state != previous_state:
542-
# TODO - change back to original logging
543541
_LOGGER.warning(
544542
"Job state changed to %s",
545543
self.runner_api_state_to_pipeline_state(current_state))
@@ -590,7 +588,7 @@ def _observe_state(self, message_thread):
590588

591589
def _cleanup(self, on_exit: bool = False) -> None:
592590
if on_exit and self._cleanup_callbacks:
593-
_LOGGER.info(
591+
_LOGGER.warning(
594592
'Running cleanup on exit. If your pipeline should continue running, '
595593
'be sure to use the following syntax:\n'
596594
' with Pipeline() as p:\n'

0 commit comments

Comments
 (0)