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

Logging in Library

asked 2022-10-13 08:44:58 -0500

I'm currently working on a library that will be used within ROS nodes. Since the library is ros-agnostic, I'm not sure how to include logging in a way that would interface with rosconsole when run within ros nodes and stdout for other usecases.

Is there an intended/easy way to do this?

edit retag flag offensive close merge delete

Comments

ROS 2 comes with logging functionality and is the easiest to use, IMHO. I am just wondering why you are reinventing the wheel.

ravijoshi gravatar image ravijoshi  ( 2022-10-14 03:23:24 -0500 )edit

As he writes he try to get an ros agnostic lib.

duck-development gravatar image duck-development  ( 2022-10-16 10:27:30 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-16 10:31:08 -0500

duck-development gravatar image

You need logging if something goes wrong for this you can use exceptions. And the ros caller code would log those.

For development porpoises you can use printf.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-10-13 08:44:58 -0500

Seen: 66 times

Last updated: Oct 16 '22