Skip to content

fix(aggregators): avoid KeyError for unknown ROS log levels#798

Merged
maciejmajek merged 1 commit into
RobotecAI:bartok9/fixesfrom
Bartok9:fix/logs-aggregator-keyerror
Jul 22, 2026
Merged

fix(aggregators): avoid KeyError for unknown ROS log levels#798
maciejmajek merged 1 commit into
RobotecAI:bartok9/fixesfrom
Bartok9:fix/logs-aggregator-keyerror

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 10, 2026

Copy link
Copy Markdown

Summary

ROS2LogsAggregator mapped log severity with self.levels[log.level], which KeyErrors for values outside {10,20,30,40,50} (custom / operator-defined levels). That can crash the agent when очавое summarizing logs.

Changes

  • levels.get(log.level, str(log.level))
  • Unit test with DummyLog(level=25, ...)

Verification

New unit test (full suite needs ROS env as existing aggregator tests).

Duplicate check

No open PR for this KeyError path.

Use levels.get(..., str(level)) when formatting ROS2LogsAggregator
output so non-standard severities do not crash the agent loop.
@maciejmajek
maciejmajek changed the base branch from main to bartok9/fixes July 22, 2026 10:04
@maciejmajek
maciejmajek merged commit fbb88c2 into RobotecAI:bartok9/fixes Jul 22, 2026
2 checks passed
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.

2 participants