Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Logging] Clarify duration arg description in macros #359

Merged
merged 1 commit into from
May 17, 2022

Conversation

aprotyas
Copy link
Member

Quoting from ros2/rclcpp#1929:

Currently RCLCPP_*_THROTTLE (and the RCUTILS_LOG_*_THROTTLE_NAMED which they cal) arbitrarily accept the duration as an integral value of milliseconds. This is highly confusing, especially since it is not documented anywhere but deep in the source, in RCUTILS_LOG_CONDITION_THROTTLE_BEFORE, where it calls:

static rcutils_duration_value_t __rcutils_logging_duration = RCUTILS_MS_TO_NS((rcutils_duration_value_t)duration); 

The expectation that the duration argument to the logging macros will be an integral value in milliseconds is not explicit at all, and as such the documentation for this argument should be clarified.

Signed-off-by: Abrar Rahman Protyasha aprotyas@u.rochester.edu

The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement, thanks @aprotyas ! Will run CI on it next.

@clalancette
Copy link
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@fujitatomoya fujitatomoya merged commit 8da2aac into master May 17, 2022
@delete-merged-branch delete-merged-branch bot deleted the aprotyas/clarify_duration_doc branch May 17, 2022 20:41
@aprotyas
Copy link
Member Author

Thanks for the reviews and for merging the PR! I'll open backports to Humble, Galactic, and Foxy since it's backwards compatible a nice QoL improvement on the status quo.

@aprotyas
Copy link
Member Author

@mergify backport humble galactic foxy

mergify bot pushed a commit that referenced this pull request May 18, 2022
The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
(cherry picked from commit 8da2aac)
mergify bot pushed a commit that referenced this pull request May 18, 2022
The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
(cherry picked from commit 8da2aac)
@mergify
Copy link

mergify bot commented May 18, 2022

backport humble galactic foxy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 18, 2022
The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
(cherry picked from commit 8da2aac)
clalancette pushed a commit that referenced this pull request May 27, 2022
The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
(cherry picked from commit 8da2aac)

Co-authored-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
clalancette pushed a commit that referenced this pull request May 27, 2022
The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
(cherry picked from commit 8da2aac)

Co-authored-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
clalancette pushed a commit that referenced this pull request May 27, 2022
The expectation that the `duration` argument to the logging macros will
be an integral value in milliseconds is not explicit at all, and as such
the documentation for this argument should be clarified.

Prior to this change, this information could only be found inside
`RCUTILS_LOG_CONDITION_THROTTLE_BEFORE`, which is inconvenient.

Signed-off-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
(cherry picked from commit 8da2aac)

Co-authored-by: Abrar Rahman Protyasha <aprotyas@u.rochester.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants