You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "shunping (via GitHub)" <gi...@apache.org> on 2025/06/21 04:30:02 UTC

[PR] Improve LogElements to show pane_info and timestamps in seconds. [beam]

shunping opened a new pull request, #35387:
URL: https://github.com/apache/beam/pull/35387

   (no comment)


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve LogElements to show pane_info and timestamps in seconds. [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35387:
URL: https://github.com/apache/beam/pull/35387#discussion_r2162321085


##########
sdks/python/apache_beam/transforms/util.py:
##########
@@ -1445,30 +1445,50 @@ class LogElements(PTransform):
     level: (optional) The logging level for the output (e.g. `logging.DEBUG`,
         `logging.INFO`, `logging.WARNING`, `logging.ERROR`). If not specified,
         the log is printed to stdout.
+    with_pane_info (bool): (optional) Whether to include element's pane info.
+    use_rfc3339 (bool): (optional) Whether to display timestamps in rfc3339

Review Comment:
   Done. I like the new parameter name you proposed. Thanks!



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve LogElements to show pane_info and timestamps in seconds. [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping commented on code in PR #35387:
URL: https://github.com/apache/beam/pull/35387#discussion_r2162319641


##########
sdks/python/apache_beam/transforms/util.py:
##########
@@ -1445,30 +1445,50 @@ class LogElements(PTransform):
     level: (optional) The logging level for the output (e.g. `logging.DEBUG`,
         `logging.INFO`, `logging.WARNING`, `logging.ERROR`). If not specified,
         the log is printed to stdout.
+    with_pane_info (bool): (optional) Whether to include element's pane info.
+    use_rfc3339 (bool): (optional) Whether to display timestamps in rfc3339
+        format.
   """
   class _LoggingFn(DoFn):
     def __init__(
-        self, prefix='', with_timestamp=False, with_window=False, level=None):
+        self,
+        prefix='',
+        with_timestamp=False,
+        with_window=False,
+        with_pane_info=False,
+        use_rfc3339=True,
+        level=None):

Review Comment:
   Fixed.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve LogElements to show pane_info and timestamps in seconds. [beam]

Posted by "shunping (via GitHub)" <gi...@apache.org>.
shunping merged PR #35387:
URL: https://github.com/apache/beam/pull/35387


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve LogElements to show pane_info and timestamps in seconds. [beam]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #35387:
URL: https://github.com/apache/beam/pull/35387#issuecomment-2993359601

   Assigning reviewers:
   
   R: @damccorm for label python.
   
   
   Note: If you would like to opt out of this review, comment `assign to next reviewer`.
   
   Available commands:
   - `stop reviewer notifications` - opt out of the automated review tooling
   - `remind me after tests pass` - tag the comment author after tests pass
   - `waiting on author` - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)
   
   The PR bot will only process comments in the main thread (not review comments).


-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Improve LogElements to show pane_info and timestamps in seconds. [beam]

Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on code in PR #35387:
URL: https://github.com/apache/beam/pull/35387#discussion_r2161683527


##########
sdks/python/apache_beam/transforms/util.py:
##########
@@ -1445,30 +1445,50 @@ class LogElements(PTransform):
     level: (optional) The logging level for the output (e.g. `logging.DEBUG`,
         `logging.INFO`, `logging.WARNING`, `logging.ERROR`). If not specified,
         the log is printed to stdout.
+    with_pane_info (bool): (optional) Whether to include element's pane info.
+    use_rfc3339 (bool): (optional) Whether to display timestamps in rfc3339
+        format.
   """
   class _LoggingFn(DoFn):
     def __init__(
-        self, prefix='', with_timestamp=False, with_window=False, level=None):
+        self,
+        prefix='',
+        with_timestamp=False,
+        with_window=False,
+        with_pane_info=False,
+        use_rfc3339=True,
+        level=None):

Review Comment:
   Nit: Param order doesn't match order in pydoc



##########
sdks/python/apache_beam/transforms/util.py:
##########
@@ -1445,30 +1445,50 @@ class LogElements(PTransform):
     level: (optional) The logging level for the output (e.g. `logging.DEBUG`,
         `logging.INFO`, `logging.WARNING`, `logging.ERROR`). If not specified,
         the log is printed to stdout.
+    with_pane_info (bool): (optional) Whether to include element's pane info.
+    use_rfc3339 (bool): (optional) Whether to display timestamps in rfc3339

Review Comment:
   This parameter name is hard to understand, and it is surprising to have one param that defaults to True while the rest default to False. What if we named this `use_epoch_time`? I think people have a better shot of knowing what this means and it lets us keep the defaults to False.
   
   



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org