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

How to log in separate file per node

asked 2020-10-16 07:16:43 -0500

alex_ gravatar image

updated 2020-10-16 07:17:21 -0500

Hi community!

In the .ros/log/{cryptic_someting}/ folder I see some nodes create their own log files: E.g.: controller_spawner-3.log or rqt_robot_steering-5.log

How can I achieve that for my own nodes? - Until now all my log messages are written in the roslaunch.log

Thanks in advance Alex

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-10-16 21:53:49 -0500

miura gravatar image

updated 2020-10-19 08:39:46 -0500

using ROS_INFO function to display the log message and you can do this by setting output="log" to a node in the launch file.

Reference

edit flag offensive delete link more

Comments

It worked thanks. Extra question: Do you know how to set it up that it logs to the separate file AND outputs to the screen?

alex_ gravatar image alex_  ( 2020-10-19 00:53:00 -0500 )edit

Do you mean: output="log" ? There is no 'display' parameter in node.

MadeleineP gravatar image MadeleineP  ( 2020-10-19 07:59:57 -0500 )edit

@alex_ I'm glad I could help you. may be you can use the tee command. If you want to have any further interaction, please do so on a separate question page.

miura gravatar image miura  ( 2020-10-19 08:37:03 -0500 )edit

@MadeleineP Thank you for pointing this out. You are right. I have reflected it.

miura gravatar image miura  ( 2020-10-19 08:40:43 -0500 )edit

@miura, I have added output="log" to my launch file, and I receive all of my ROS_INFO messages in rosout.log. A separate log file for my node is not being created. However, several other nodes are logging to their own log files. Is there something else I need to do? Thanks.

MadeleineP gravatar image MadeleineP  ( 2020-10-19 09:35:47 -0500 )edit

@MadeleineP You are probably running into the behavior described in this question that also includes a link to an open bug report.

jarvisschultz gravatar image jarvisschultz  ( 2020-10-19 10:17:30 -0500 )edit

@MadeleineP The answer from miura san worked for me (Ubuntu 16.04) therefore I marked it as correct.

alex_ gravatar image alex_  ( 2020-10-20 00:56:08 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-10-16 07:16:43 -0500

Seen: 1,488 times

Last updated: Oct 19 '20