Logger child not publish in /rosout
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
Execute the next code.
import rclpy
from rclpy.node import Node
def main():
rclpy.init()
node = Node("Test")
node.get_logger().info("Message parent")
node.get_logger().get_child("child").info("Message child")
node.destroy_node()
rclpy.try_shutdown()
if __name__ == "__main__":
main()
Expected behavior
Both loggers should be apeear in rosout.
Screenshots
Only the message from the parent is received in the topic /rosout
Environment (please complete the following information):
- OS: Ubuntu 22.04
- Version ROS: humble
@halejo-as thanks for creating issue.
this problem has been addressed by https://github.com/ros2/rcl/pull/1115, jazzy and rolling do not have this problem anymore.
### console output
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 run prover_rclpy rclpy_1407
[INFO] [1738264388.590734963] [Test]: Message parent
[INFO] [1738264388.591074152] [Test.child]: Message child
### rosout
root@tomoyafujita:~/ros2_ws/colcon_ws# ros2 topic echo /rosout
stamp:
sec: 1738264388
nanosec: 590734963
level: 20
name: Test
msg: Message parent
file: /root/ros2_ws/colcon_ws/build/prover_rclpy/src/rclpy_1407.py
function: main
line: 8
---
stamp:
sec: 1738264388
nanosec: 591074152
level: 20
name: Test.child
msg: Message child
file: /root/ros2_ws/colcon_ws/build/prover_rclpy/src/rclpy_1407.py
function: main
line: 9
---
https://github.com/ros2/rcl/pull/1115 created the new return code RCL_RET_NOT_FOUND and added it to rcl_logging_rosout_add_sublogger, so technically this does not break the API/ABI. However, if client code is compiled with assumptions about a fixed set of return values and behaves incorrectly when receiving a new value, it might cause unintended behavior without breaking ABI in the strictest sense.
at this moment, i do not think we are going to work on the backport for humble.
Ok thank you for the update
Thank you for the issue!
I'll close this for now since the fix won't be backported to ROS Humble.