Robotics StackExchange | Archived questions

How do I tell the ros2 daemon to log to stdout?

How do I tell the ros2 daemon to log to stdout?

I know about ROS_LOG_DIR (https://wiki.ros.org/ROS/EnvironmentVariables#ROS_LOG_DIR), but that doesn't help. If there were a ROS_LOG_FILE, then I would have tried setting it to /dev/stdout.

Here's an Amazon person talking about it (https://discourse.ros.org/t/ros2-logging/6469), but that conversation seems more like a wishlist than a spec.

Asked by rubicks on 2021-04-15 14:54:48 UTC

Comments

Answers

How do I tell the ros2 daemon to log to stdout?

I know about ROS_LOG_DIR (https://wiki.ros.org/ROS/EnvironmentVariables#ROS_LOG_DIR), but that doesn't help. If there were a ROS_LOG_FILE, then I would have tried setting it to /dev/stdout.

the ROS 2 daemon is for .. ROS 2.

The wiki you refer to documents ROS 1 environment variables. That won't help with configuring the daemon.

Afaik the only way to get it to output anything is to enable debug mode using the --debug option (otherwise all output streams are set to /dev/null):

$ ros2 daemon start --help
usage: ros2 daemon start [-h] [--debug]

Start the daemon if it isn't running

optional arguments:
  -h, --help   show this help message and exit
  --debug, -d  Print debug messages

it'll still detach though, so I'm not sure where messages following the ones printed during initialisation go.

Asked by gvdhoorn on 2021-04-16 02:54:28 UTC

Comments

Probably related: #q373411.

Asked by gvdhoorn on 2021-06-09 04:08:00 UTC