ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I don't think there is a "best practice" for what you're trying to do, but I do have a comment on your first option. Catching _any_ exception that comes out of rclpy.spin(node_class) followed by using node_class's logger is potentially unsafe. It's possible (although fairly unlikely) that node_class or its logger is in an unknown state due to an error when you try to log the traceback.