Polber commented on code in PR #30005:
URL: https://github.com/apache/beam/pull/30005#discussion_r1464241008
##########
sdks/python/apache_beam/yaml/yaml_provider.py:
##########
@@ -731,14 +731,46 @@ def _parse_window_spec(spec):
return beam.WindowInto(window_fn)
@staticmethod
- def log_for_testing():
+ def log_for_testing(
+ level: Optional[str] = 'INFO', prefix: Optional[str] = ''):
"""Logs each element of its input PCollection.
The output of this transform is a copy of its input for ease of use in
chain-style pipelines.
+
+ Args:
+ level: one of ERROR, INFO, or DEBUG, mapped to a corresponding
+ language-specific logging level
+ prefix: an optional identifier that will get prepended to the element
+ being logged
"""
+ # Keeping this simple to be language agnostic.
+ # The intent is not to develop a logging library (and users can always do)
+ # their own mappings to get fancier output.
+ log_levels = {
+ 'ERROR': logging.error,
+ 'INFO': logging.info,
+ 'DEBUG': logging.debug,
+ }
Review Comment:
Ok makes sense, I agree
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]