Skip to content

feat(log_bridge): add /rosout to faults bridge#422

Open
mfaferek93 wants to merge 2 commits into
mainfrom
feat/420-log-bridge
Open

feat(log_bridge): add /rosout to faults bridge#422
mfaferek93 wants to merge 2 commits into
mainfrom
feat/420-log-bridge

Conversation

@mfaferek93

Copy link
Copy Markdown
Collaborator

Adds ros2_medkit_log_bridge, a drop-in compatibility adapter (same category as ros2_medkit_diagnostic_bridge) that subscribes to /rosout and promotes WARN+/ERROR/FATAL log entries to FaultManager faults.

  • Each fault is attributed to the originating node via a per-node FaultReporter, so source_id is the node FQN and the fault associates with the runtime-discovered entity (snapshot/rosbag included).
  • fault_code is auto-generated and stable across occurrences (hash over a normalized message template: digits/hex/paths stripped).
  • Configurable severity floor, code prefix, and node include/exclude lists. No changes to the user's nodes.

Native ros2_medkit_fault_reporter instrumentation stays the canonical path; this bridge is the fallback for nodes that only log.

Unit tests cover level-to-severity mapping, fault_code generation/stability, and source_id normalization.

Closes #420

New ros2_medkit_log_bridge: subscribes /rosout and promotes WARN+/ERROR/
FATAL log entries to FaultManager faults, attributed to the originating node
FQN so each fault associates with the runtime-discovered entity. Drop-in,
no publisher code changes.

Refs #420
Copilot AI review requested due to automatic review settings June 15, 2026 16:53
@mfaferek93 mfaferek93 marked this pull request as draft June 15, 2026 16:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new ROS 2 package (ros2_medkit_log_bridge) that subscribes to /rosout and promotes WARN+/ERROR/FATAL log entries into medkit FaultManager faults, attributing each fault to the originating node and generating stable fault codes.

Changes:

  • Introduces LogBridgeNode (subscription, filtering, source_id normalization, fault_code generation) and a runnable executable + launch file.
  • Adds package configuration (config/log_bridge.yaml) and end-user documentation (README.md, CHANGELOG.rst).
  • Adds GTest unit coverage for severity mapping, message normalization, fault_code stability, and source_id normalization.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/ros2_medkit_log_bridge/test/test_log_bridge.cpp Unit tests for mapping/normalization/fault code/source_id behavior
src/ros2_medkit_log_bridge/src/main.cpp Entry point to spin the bridge node
src/ros2_medkit_log_bridge/src/log_bridge_node.cpp Core bridge implementation: subscribe /rosout, filter, report faults
src/ros2_medkit_log_bridge/include/ros2_medkit_log_bridge/log_bridge_node.hpp Public interface and documentation for LogBridgeNode
src/ros2_medkit_log_bridge/config/log_bridge.yaml Default parameters for topic, severity floor, code prefix, filters
src/ros2_medkit_log_bridge/launch/log_bridge.launch.py Launch description to run the node with the default config
src/ros2_medkit_log_bridge/CMakeLists.txt Build targets + test setup
src/ros2_medkit_log_bridge/package.xml Package metadata and dependencies
src/ros2_medkit_log_bridge/README.md Usage docs and behavioral notes
src/ros2_medkit_log_bridge/CHANGELOG.rst Package changelog entry

Comment thread src/ros2_medkit_log_bridge/CMakeLists.txt
Comment thread src/ros2_medkit_log_bridge/src/log_bridge_node.cpp Outdated
Comment thread src/ros2_medkit_log_bridge/src/log_bridge_node.cpp Outdated
Comment thread src/ros2_medkit_log_bridge/src/log_bridge_node.cpp
Stable FNV-1a fault_code, uniform node_source_id for code/eligibility/self-exclusion, sanitized code_prefix, LRU-bounded reporters, per-code forward cooldown, severity_floor validation, and a null guard in map_level_to_severity. Unique test domain range, dropped unused test_depends, added unit coverage; docs corrected (WARN two-stage debounce, namespaced-node limit).
@mfaferek93 mfaferek93 force-pushed the feat/420-log-bridge branch from 5cf9a8b to 547c6bb Compare June 15, 2026 19:36
@mfaferek93 mfaferek93 marked this pull request as ready for review June 15, 2026 20:21
@mfaferek93 mfaferek93 requested a review from bburda June 15, 2026 20:21
@mfaferek93 mfaferek93 self-assigned this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(fault_pack): promote /rosout WARN+/ERROR/FATAL to faults

2 participants