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

add format overriding by environment variables #722

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

SammyRamone
Copy link
Contributor

This is a proposed fix for ros2/launch_ros#368
Originally, I planned on reusing the RCUTILS_CONSOLE_OUTPUT_FORMAT environment variable for this. Hoewever, this is not possible since launch and rcutils rely on two different logging implementations which have different names for the same things. For example one supports {line_number} and the other {lineno}. Instead I added two environment variables OVERRIDE_LAUNCH_SCREEN_FORMAT and OVERRIDE_LAUNCH_LOG_FORMAT since screen and log formatting is handled differently in the code.
I also framed the variables as override similar to #713

Any feedback is welcome.

@SammyRamone
Copy link
Contributor Author

friendly ping @adityapande-1995 @methylDragon @wjwwood

Copy link
Contributor

@methylDragon methylDragon left a comment

Choose a reason for hiding this comment

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

Heya, thanks for the contribution! I'm not in principle opposed to this, but could you add a test to the logging test for this? That would help prevent regressions!

https://github.com/ros2/launch/blob/cef1ce3217cd39e339bbaa8c62d8868392fbcba0/launch/test/launch/test_logging.py

@SammyRamone
Copy link
Contributor Author

Sorry for the long wait. This was fairly low-priority for me and I only now had time to work on it again.
I added a test for the environment variables and also ensured that the other tests don't fail if the environment variable is set in the terminal in which the tests are executed.

@SammyRamone
Copy link
Contributor Author

I also added a draft PR for documenting this PR ros2/ros2_documentation#4061

@SammyRamone
Copy link
Contributor Author

friendly ping @methylDragon

@adityapande-1995
Copy link
Contributor

@SammyRamone thanks for the patience ! The team had a discussion about this, and while we do think there should be a holistic way to configure all of this logging, this is a good feature. I'll run full CI on this.

@adityapande-1995
Copy link
Contributor

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

@adityapande-1995 adityapande-1995 merged commit 749a6e5 into ros2:rolling Jan 29, 2024
3 checks passed
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