Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting log Debug level works only in code #488

Open
ralwing opened this issue Feb 19, 2021 · 2 comments
Open

Setting log Debug level works only in code #488

ralwing opened this issue Feb 19, 2021 · 2 comments
Labels
backlog bug Something isn't working

Comments

@ralwing
Copy link

ralwing commented Feb 19, 2021

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04...)
  • Installation type:
    • official foxy docker image
  • Version or commit hash:
  • DDS implementation: rmw_fastrtps_cpp
  • Client library (if applicable):

Steps to reproduce issue

create a ComposableNode

import launch
from launch_ros.actions import ComposableNodeContainer, Node
from launch_ros.descriptions import ComposableNode

def generate_launch_description():
    container = ComposableNodeContainer(
        name="container",
        namespace="",
        package="rclcpp_components",
        executable="component_container",
        composable_node_descriptions=[

            ComposableNode(
                package="localization",
                plugin="LocalizationNode",
                name="localization"
            )
        ],
        arguments=['--ros-args', '--log-level', 'DEBUG'] 
    )

    return launch.LaunchDescription([container])

Expected behavior

The log level is set to debug

Actual behavior

The log level doesn't change

Additional information

There are some topics related to this on answers.ros.org:
https://answers.ros.org/question/311471/selecting-log-level-in-ros2-launch-file/
https://answers.ros.org/question/370288/ros2-how-do-you-set-verbosity-of-a-composable-node/#370389

#383

Setting log level to at least info works fine, setting log level in source code also works:

rcutils_ret_t rcutils_logging_set_logger_level (const char *name, int level);

Feature request

Allow setting Debug severity log.

@tfoote tfoote transferred this issue from ros2/ros2 Feb 20, 2021
@fujitatomoya
Copy link

Setting log level to at least info works fine

i do not think so, this is default level so it just seems to work.
we can check that with arguments=['--ros-args', '--log-level', 'WARN'], this should not print any [INFO] messages.

as far as i can see from the source code, ComposableNodeContainer(Node).arguments are assigned to be user-defined arguments, not ros specific command line flags.

https://github.com/ros2/launch_ros/blob/d1c497878274a4ea6a1c1865fe74e395b961ba1f/launch_ros/launch_ros/actions/node.py#L146-L149

@hidmic hidmic added the bug Something isn't working label Mar 9, 2021
@hidmic
Copy link
Contributor

hidmic commented Mar 9, 2021

This may be due to components having their own configuration separate from that of the container (see here). ros2/rclcpp#978 is tracking that limitation, though I haven't got around to do what I said I was going to do then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants