xqms / rosmon

ROS node launcher & monitoring daemon
Other
180 stars 47 forks source link

Add options for console logging Node name right justification #182

Closed mitch-galea closed 7 months ago

mitch-galea commented 8 months ago

Hello,

Some of the node names in our launch file are very long, with the right justification of ros node names and paired with journalctl logs means that the output can look pretty ugly, especially for the nodes with short names.

Dec 13 07:38:01 robot[17898]: /RobotHandler/really_really_really_really_really_really_really_really_really_really_long_node_name: [robot_handler::Class::Function]: Requesting Full  data via server
Dec 13 07:38:01 robot[17898]:                                                                 /RobotSystem/robot_state_publisher: [RobotStatePublisher::publishTransforms]: Joint state with name: "joint_name" was received but not found in URDF

image

We have noticed the issue when updating from 2.3.2 -> 2.5.1. Below is what we think is the cause: image

Could an option be added to disable right justification / alignment of log output or set a max_length value manually rather than computing it based on the longest node

xqms commented 8 months ago

Just to make sure: You care about the justification in journald, right? The code snippet in your screenshot is about stdout.

Maybe we should switch off the alignment in the syslog/journald output altogether? Not sure if anyone cares about that there.

xqms commented 8 months ago

Ah, now I understand: You are running rosmon from systemd and so the stdout goes to journald. Hm, yes, I guess we would need an option for that.

An alternative for you would be to switch off stdout forwarding in systemd service:

[Service]
...
StandardOutput=null

(reference: https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#StandardOutput=)

Instead, you would enable rosmon's own logging system by specifying the --log=syslog parameter. That system does not justify/align anything :)