Skip to content

InitOptions::auto_initialize_logging(true) does not work with assignment operator. #1258

@fujitatomoya

Description

@fujitatomoya

Bug report

  • Operating System:
    • Ubuntu20.04
  • Installation type:
    • source build
  • Version or commit hash:
  • DDS implementation:
    • N.A
  • Client library (if applicable):
    • rclcpp

Steps to reproduce issue

  • build the following test.
int main(int argc, char * argv[])
{
  rclcpp::init(argc, argv);
  auto options = rclcpp::InitOptions().auto_initialize_logging(false);
  if (options.auto_initialize_logging()) {
    std::cout << "options.auto_initialize_logging() is true\n";
    return EXIT_FAILURE;
  } else {
    std::cout << "options.auto_initialize_logging() is false\n";
    return EXIT_SUCCESS;
  }
}
  • run application
# ros2 run ros2_test_prover tmp
options.auto_initialize_logging() is true

Expected behavior

# ros2 run ros2_test_prover tmp
options.auto_initialize_logging() is false

Actual behavior

# ros2 run ros2_test_prover tmp
options.auto_initialize_logging() is true

Additional information

initialize_logging_ should be copied via constructor and assignment operator =. also it would be better to add test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions