Robotics StackExchange | Archived questions

how to change default logging verbosity

Using ROS2 when running a launch file it always start like this:

[INFO] [launch]: All log files can be found below

[INFO] [launch]: Default logging verbosity is set to INFO

Is it possible to change this default verbosity?

I know that it is possible to change a Node execution verbosity using this:

--ros-args --log-level

but what about the default verbosity when running a launch file? I cannot changed it from INFO

Thank you!

Asked by iggyrrieta on 2022-12-18 07:09:36 UTC

Comments

Answers

Please check out these:

E.g. for Foxy

launch_ros.actions.Node(
    package='demo_nodes_cpp',
    executable='talker',
    output='screen', 
    arguments=['--ros-args', '--log-level', 'debug']
)

Asked by ljaniec on 2022-12-18 14:04:36 UTC

Comments

Thank you for your response, this is actually what I am doing and i can set the logger of the node I am executing. However what I can't change is the default [INFO][launch] messages that appear when running a launch file.

For example, if you make a new ros2 package which cointains only the follwing launch file:

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    return LaunchDescription([               
        Node(
            package='teleop_twist_joy',
            executable='teleop_node',
            name='teleop_twist_joy_node',
            arguments=['--ros-args', '--log-level', 'fatal']),
         Node(
            package='joy', 
            executable='joy_node', 
            name='joy_node',
            arguments=['--ros-args', '--log-level', 'fatal'])
    ])  

You still get the following output:

Asked by iggyrrieta on 2022-12-18 14:43:40 UTC

Log:

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [teleop_node-1]: process started with pid [13112]
[INFO] [joy_node-2]: process started with pid [13114]

Asked by iggyrrieta on 2022-12-18 14:44:22 UTC