Skip to content

feat: install the SolidSyslog error handler - #29

Merged
DavidCozens merged 1 commit into
mainfrom
stage/error-handler
Jul 29, 2026
Merged

feat: install the SolidSyslog error handler#29
DavidCozens merged 1 commit into
mainfrom
stage/error-handler

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Pull request

What this stage adds

Nothing in the library fails loudly. A _Create that cannot succeed returns a Null
object and carries on, so a logger that has silently stopped looks exactly like
one with nothing to say. The handler is what tells them apart, and it goes in
before the first _Create rather than after something looks wrong.

Flash +404 B
RAM +8 B

The handler prints to the same console as everything else, so a fault lands in
the run report next to the rest of what the device did. It names the four
lifecycle categories a misconfigured integration raises and prints the rest
numerically — a device reacting to those would switch on the range, not the text.

That is 404 bytes for something this device may never use. It buys the
difference between a silent failure and a sentence, which is worth more than the
bytes on anything that has to be trusted to report.

Files

 CMakeLists.txt                  |  2 +
 README.md                       | 10 +++--
 app/main.c                      |  4 ++
 app/syslog/SyslogErrorHandler.c | 89 +++++++++++++++++++++++++++++++++++++++++
 app/syslog/SyslogErrorHandler.h | 15 +++++++
 measurements/error-handler.csv  | 13 ++++++
 measurements/stages.tsv         |  1 +
 run-report.md                   | 30 +++++++-------
 8 files changed, 145 insertions(+), 19 deletions(-)

Checklist

  • The diff touches build infra (1 file(s)) — see Files above; deliberate for this stage.
  • measurements/error-handler.csv committed.
  • Row added to measurements/stages.tsv.
  • README regenerated: python3 scripts/gen-cost-table.py.
  • ./run.sh green (build + QEMU + baseline self-check) — run-report.md committed.

Context for review: 2 of 21 sequential single-commit PRs replaying the integration on top of the Baseline root. Each lands green and reviewed before the next is built on it, because a change to an early commit would force every commit above it to be re-run and re-measured.

Summary by CodeRabbit

  • New Features

    • Added startup error handling for system logging.
    • Syslog errors now report readable severity and category information in the device console.
    • Unrecognized error categories remain visible through their numeric values.
  • Documentation

    • Updated staged integration guidance to describe the error-handler stage and its resource impact.
    • Refreshed run-report measurements and validation results for the new stage.

Nothing in the library fails loudly. A _Create that cannot succeed returns a Null
object and carries on, so a logger that has silently stopped looks exactly like
one with nothing to say. The handler is what tells them apart, and it goes in
before the first _Create rather than after something looks wrong.

  Flash  +404 B
  RAM      +8 B

The handler prints to the same console as everything else, so a fault lands in
the run report next to the rest of what the device did. It names the four
lifecycle categories a misconfigured integration raises and prints the rest
numerically — a device reacting to those would switch on the range, not the text.

That is 404 bytes for something this device may never use. It buys the
difference between a silent failure and a sentence, which is worth more than the
bytes on anything that has to be trusted to report.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The application adds a syslog error handler module, registers it before object creation, includes it in the baseline build, and updates documentation and measurement reports for the new error-handler stage.

Changes

Syslog error handler

Layer / File(s) Summary
Error handler implementation
app/syslog/SyslogErrorHandler.h, app/syslog/SyslogErrorHandler.c
Adds the installer API, severity and category mappings, null-safe event formatting, and registration through SolidSyslog_SetErrorHandler.
Startup and build integration
CMakeLists.txt, app/main.c
Compiles the handler, adds its include directory, and installs the callback before the first application object creation.
Stage documentation and measurements
README.md, run-report.md
Renames the stage to “Error handler” and updates cost, ELF-size, runtime metrics, and self-check data.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant main
  participant SyslogErrorHandler
  participant SolidSyslog
  participant Console
  main->>SyslogErrorHandler: Install before first _Create
  SyslogErrorHandler->>SolidSyslog: Register OnSyslogError
  SolidSyslog->>SyslogErrorHandler: Report error event
  SyslogErrorHandler->>Console: Print formatted error
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: installing the SolidSyslog error handler.
Description check ✅ Passed The description matches the template with a 'What this stage adds' section and a filled checklist covering measurements, README regeneration, and run.sh.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stage/error-handler

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@run-report.md`:
- Around line 52-62: Update the Self-check results in run-report.md so
measurements only receive “OK” when actual and expected values match exactly;
otherwise report a mismatch or fail the check. Regenerate
measurements/error-handler.csv and the report from the same build so
mbedtls_peak, mbedtls_free, and lwip_pbufs_free no longer show inconsistent
values as successful.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c6162096-2a8e-42b7-8ce9-5f8f85495da8

📥 Commits

Reviewing files that changed from the base of the PR and between 3461555 and 4aa5e5e.

⛔ Files ignored due to path filters (2)
  • measurements/error-handler.csv is excluded by !**/*.csv
  • measurements/stages.tsv is excluded by !**/*.tsv
📒 Files selected for processing (6)
  • CMakeLists.txt
  • README.md
  • app/main.c
  • app/syslog/SyslogErrorHandler.c
  • app/syslog/SyslogErrorHandler.h
  • run-report.md

Comment thread run-report.md
@DavidCozens
DavidCozens merged commit c2c95ea into main Jul 29, 2026
2 checks passed
@DavidCozens
DavidCozens deleted the stage/error-handler branch July 29, 2026 12:34
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.

1 participant