Skip to content

External logging level configuration #1355

@fujitatomoya

Description

@fujitatomoya

Feature request

Feature description

Ability to configure logging level externally at runtime.

In the future there will be a generalized approach to external configuration of loggers at runtime

see https://docs.ros.org/en/rolling/Tutorials/Demos/Logging-and-logger-configuration.html#logger-level-configuration-externally

image

Requirements

  • ROS 2 application (including ros2cli) can change the logging level for specific node during runtime.
  • Node developer can opt-in this option via Node:Options. (in default, this is disabled.)
  • Node is only be able to set the logging level of logger name that belongs to that node process space.

Implementation Consideration

  • GUI tools are not in scope of this issue, this is dedicated to node interface.
  • Expose additional service for each node to set and get the logging level of logger name at runtime.
    • service path: /nodename/get_logger_level and /nodename/set_logger_level.
  • This could be one of the Node::Options that user opt-in if they want to. Since this is debug feature and adding extra service, this should not be opt-out.
  • If using components node, requesting to change logger level to Node-A would be effectively changing logger level in Node-B.
    • This is because that logger level hash map is maintained by in the process space.
    • logger names and levels are maintained agnostic from node configuration, logging level will be applied once the corresponding node is created.
  • Not only for setting the logging level, but also user should be able to know the current logging level via service?
    • Probably yes, it is likely that user application might want to check the current logging level during runtime.
    • rcl_create_node_logger_name is internally issued and creates logger name for that node, but user application can create other rclcpp::Logger if needed.
  • ROS 2 system debugging level should be accepted as well by default, such as rclcpp, rcl and rclpy.
    • This could be really useful to debug ROS 2 core system during application running.
  • This feature requires service file must have the field to specify the logger_name and logger_level.
  • Supporting user callback to be called on service request?
    • Probably no, what is the actual use case for this?

Sample Demo

Tasks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions