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

Improve error message handling for spdlog #110

Draft
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

christophebedard
Copy link
Member

@christophebedard christophebedard commented Feb 28, 2024

Kind of relates to ros2/rcutils#269

  1. Modify tests to expect the error message to be set when it should be set and then reset it
  2. In rcl_logging_spdlog's rcl_logging_external_initialize(): in case of rcl_logging_get_logging_directory() failure, append error message instead of overwriting it without resetting it (and thus generating a "This error state is being overwritten" warning)
    • The error message looks like:
      Failed to get logging directory: rcutils_join_path failed, at /home/user/ros2_ws/src/ros2/rcl_logging/rcl_logging_interface/src/logging_dir.c:59, at /home/user/ros2_ws/src/ros2/rcl_logging/rcl_logging_spdlog/src/rcl_logging_spdlog.cpp:136
      
  3. Document that rcl_logging_external_initialize() must/should(?) set an error message if it returns RCL_LOGGING_RET_ERROR

This results in rcl_logging_spdlog/test/test_logging_interface.cpp not generating any "This error state is being overwritten" warnings.

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
@christophebedard
Copy link
Member Author

This is a draft pending higher-level discussion for overall error message handling.

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
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.

In short, this seems reasonable to me. I'm going to hold off on approving since this is still a draft and we need to have the higher-level discussion.

Copy link
Collaborator

@fujitatomoya fujitatomoya left a comment

Choose a reason for hiding this comment

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

draft looks good to me

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.

None yet

3 participants