roslibjs icon indicating copy to clipboard operation
roslibjs copied to clipboard

Ros logging

Open joshua-glazer opened this issue 3 years ago • 1 comments

Public API Changes

Implements Javascript logging functionality similar to ROS logging functions logwarn, logerr, etc.

Description

Created a JS file implementing functions which log to the console and publish to rosout based on the ROS logging level. Created an example file to demonstrate how the functions are used.

Resolves #352

joshua-glazer avatar Jan 10 '22 20:01 joshua-glazer

The logging is all in an example. Would be best to make this part of the library IMO.

MatthijsBurgh avatar Jan 13 '22 14:01 MatthijsBurgh

@sea-bass @EzraBrooks What do you think of this PR?

MatthijsBurgh avatar Nov 16 '23 08:11 MatthijsBurgh

@sea-bass @EzraBrooks What do you think of this PR?

I would probably prefer to have this be part of the protocol and have the Python backend do actual logging calls through rclpy.

I say this because publishing to /rosout is a limited subset of logging that notably does not make it into console or log file -- see, e.g., https://docs.ros.org/en/rolling/Concepts/Intermediate/About-Logging.html#overview

sea-bass avatar Nov 16 '23 18:11 sea-bass

Agreed. I think the "most correct" way to implement this with my knowledge of ROS logging would be to create a protocol-level API in rosbridge + roslib that allows creating namespaced child loggers in the Python backend and then forwarding log content to those from a roslibjs log call. There are some issues with that approach, as we've seen in moveit2, but we're working on fixing them in ROS itself.

EzraBrooks avatar Nov 16 '23 18:11 EzraBrooks

I agree with the vision of @sea-bass @EzraBrooks therefore I am closing this PR.

MatthijsBurgh avatar Nov 28 '23 18:11 MatthijsBurgh