Skip to main content

Module log

Module log 

Source
Expand description

ROS 2 log file discovery and tailing.

Functionsยง

find_log_by_node
Locates a log file for the given node name by searching filenames, PID, and recent run directories.
find_log_by_pid
Finds a log file in the ROS 2 log directory whose filename contains the given PID.
find_log_for_running_node
Finds a log file for a currently running node, preferring PID-based lookup over name-based.
find_node_pid
Returns the PID of a running ROS 2 node by searching process arguments with pgrep.
read_tail
Reads the last max_lines lines from the file at path.
ros2_log_dir
Returns the ROS 2 log directory, checking ROS_LOG_DIR, ROS_HOME, and ~/.ros/log.