Skip to content

feat: install the SolidSyslog error handler - #50

Merged
DavidCozens merged 1 commit into
mainfrom
stage-02-error-handler
Aug 16, 2026
Merged

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

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Install the handler before any other call into SolidSyslog.

SolidSyslog_SetErrorHandler(OnSyslogError, NULL);

Nothing in the library fails loudly. A _Create that cannot succeed substitutes a Null object and
reports it rather than returning NULL, so a logger that has silently stopped looks exactly like
one with nothing to say. The handler is what tells the two apart, which is why it goes in before
the first _Create and not after something looks wrong. It reports many misconfiguration errors,
and can save significant time while integrating.

This is not only an integration aid. The handler is the seam into the device's own error and health
reporting, and it stays valuable at run time: later stages raise an edge-triggered warning when the
collector becomes unreachable and a notice when delivery recovers. Route it wherever the device
already routes faults — here, the same console as everything else, so a fault lands in the run
report next to the rest of what the device did.

The handler names the four lifecycle categories a misconfigured integration raises and prints the
rest numerically. A device reacting to a fault would switch on the category rather than the text,
so the names are for the reader.

Summary by CodeRabbit

  • New Features

    • Added a startup-installed syslog error handler.
    • Runtime faults now report readable severity, category, and source information.
    • Unknown or incomplete error events are handled safely with fallback details.
  • Documentation

    • Documented error-handler behavior, lifecycle coverage, and resource overhead.
  • Tests

    • Updated runtime measurements and validation for the error-handler scenario; checks continue to pass.

@DavidCozens

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f057925-1f94-49f7-acb7-526631715b51

📥 Commits

Reviewing files that changed from the base of the PR and between d492113 and 0b1af20.

⛔ 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

📝 Walkthrough

Walkthrough

The example application adds a syslog error handler, registers it during startup, includes it in the CMake build, documents its behavior and cost, and updates the measurement report for the new error-handler scenario.

Changes

Syslog error handler

Layer / File(s) Summary
Error handler contract and implementation
app/syslog/SyslogErrorHandler.h, app/syslog/SyslogErrorHandler.c
Declares and implements SyslogErrorHandler_Install(). The handler maps severity and category codes, handles null events, selects fallback sources, and formats known or unknown categories.
Startup and build integration
CMakeLists.txt, app/main.c
Adds the handler source and include path to the build. Installs the handler after UART initialization and before lwIP setup or task creation.
Documentation and measurement updates
README.md, run-report.md
Documents installation, behavior, lifecycle categories, and measured overhead. Updates the report to use the error-handler scenario and revised measurements.

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

Merge Risk: ⚪ Minimal · up to 0b1af

This change adds and registers the SolidSyslog error handler and routes its messages to the existing console output; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant main
  participant SyslogErrorHandler_Install
  participant SolidSyslog_SetErrorHandler
  participant SyslogErrorHandler
  participant Console
  main->>SyslogErrorHandler_Install: register global handler
  SyslogErrorHandler_Install->>SolidSyslog_SetErrorHandler: set callback
  SolidSyslog_SetErrorHandler-->>main: handler installed
  SolidSyslog_SetErrorHandler->>SyslogErrorHandler: deliver runtime fault
  SyslogErrorHandler->>Console: print formatted severity and category
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the handler capability and purpose but omits the required stage heading and checklist confirmations. Add the “What this stage adds” section and complete all checklist items, including measurements, README generation, and ./run.sh verification.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly and concisely describes the main change: installing the SolidSyslog error handler.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stage-02-error-handler

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

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@DavidCozens

Copy link
Copy Markdown
Contributor Author

@coderabbitai pause

Base automatically changed from stage-01-linked to main August 16, 2026 17:55
Nothing in the library fails loudly. A _Create that cannot succeed substitutes a
Null object and reports it rather than returning NULL, 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 category, not the
text.

It is more than an integration aid. The handler is the seam into the device's own
error and health reporting, and later stages use it at run time: an edge-triggered
warning when the collector becomes unreachable, a notice when delivery recovers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@DavidCozens
DavidCozens force-pushed the stage-02-error-handler branch from 0b1af20 to c481c5c Compare August 16, 2026 17:56
@DavidCozens
DavidCozens merged commit 565ee07 into main Aug 16, 2026
@DavidCozens
DavidCozens deleted the stage-02-error-handler branch August 16, 2026 17:56
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
✅ Action performed

Reviews paused.

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