Is there a way to enable debug logging for colcon test?

asked 2021-09-25 08:13:06 -0600

ijnek gravatar image

updated 2021-09-25 08:13:33 -0600

I have a gtest bar in package foo, which I generate with CMake using ament_add_gtest(). It can be run as part of colcon test, or individually by calling ws/build/foo/test/bar.

There is a a test that is failing and I would like to re-run the test with debug rclcpp logging enabled. Is there a way to do this?

edit retag flag offensive close merge delete

Comments

Have you checked this document https://docs.ros2.org/bouncy/api/rclc...

osilva gravatar image osilva  ( 2021-09-26 05:05:32 -0600 )edit

There is also this article that maybe helpful: https://discourse.ros.org/t/what-of-r...

osilva gravatar image osilva  ( 2021-09-26 05:06:49 -0600 )edit

@osilva, thanks for your response. Perhaps my question seemed like how to do logging in general, apologies. Usually I debug nodes by running ros2 run foo bar --ros-args --log-level DEBUG in ROS2, and that works fine. However, tests can't be run using ros2 run so I want to know how I can enable them for gtest executables.

ijnek gravatar image ijnek  ( 2021-09-26 05:23:21 -0600 )edit
1

Thank you for the clarification. Your question was clear I needed to read it more carefully too.

osilva gravatar image osilva  ( 2021-09-26 08:15:27 -0600 )edit