Skip to content

rcl_configure_logging and rcl_logging_fini are called multiple times when creating multiple contexts #551

@ivanpauno

Description

@ivanpauno

Feature request

Feature description

Currently, if many contexts are created, rcl_logging_configure is called many times, overriding preexisting configurations silently.
Same happens with rcl_logging_fini. That destroys the logger when the first context is destructed.

The logger should be only initialized once, and initialization of future contexts should be ignored logging a warning (or handling the error somehow).

Implementation considerations

To avoid destructing the logger at the first call, an initialization count can be implemented.
The logger should be destroyed after rcl_logging_destroy was called the same times that init.

Note

Check if something similar may be happening with other "global" configurations.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions