Skip to content

Programmatically configure log level #1166

@threeal

Description

@threeal

Feature Request

Feature Description

A c++ function to set log level of a specific logger under the rclcpp::Logger class.

Implementation Considerations

  • the current implementation could be done using the following codes, but it's based on c, not c++:
    if (rcutils_logging_set_logger_level(logger.get_name(), RCUTILS_LOG_SEVERITY_INFO) != 
    RCUTILS_RET_OK)
    {
      RCUTILS_LOG_FATAL("could not set the logger level");
    }
  • add a void function that throw an error on fail or add a boolean function that return false on fail under the rclcpp::Logger class.
  • (optional) add a more c++ friendly enum to be used to set the log level instead of using the RCUTILS_LOG_SEVERITY enum.

Metadata

Metadata

Assignees

No one assigned

    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