Skip to content

feat: create the logger, wired to nothing, and watch it say so - #30

Merged
DavidCozens merged 1 commit into
mainfrom
stage/logger
Jul 29, 2026
Merged

feat: create the logger, wired to nothing, and watch it say so#30
DavidCozens merged 1 commit into
mainfrom
stage/logger

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Pull request

What this stage adds

The logger is created with both collaborators absent, deliberately. Create never
fails and never returns NULL — a missing collaborator is substituted with its
Null object — so the only evidence is what the handler prints, and the run report
now carries three of them:

[syslog] CRITICAL SolidSyslog bad-config (detail 1)
[syslog] CRITICAL SolidSyslog bad-config (detail 2)
[syslog] CRITICAL SolidSyslog bad-config (detail 3)

Flash +1,036 B
RAM +180 B

Doing it in this order is the point. An integrator who wires everything at once
and sees nothing cannot tell a working logger from a silent one; seeing the
faults first, and then watching them go quiet as collaborators arrive, is the
difference between believing it works and knowing.

NULL is "not supplied" and is reported. A collaborator deliberately done without
is passed as its Null object instead — the library tells those two apart, and so
should anyone reading this wiring later.

Files

 CMakeLists.txt          |  1 +
 README.md               | 11 ++++++-----
 app/main.c              |  3 +++
 app/syslog/Syslog.c     | 30 ++++++++++++++++++++++++++++++
 app/syslog/Syslog.h     | 15 +++++++++++++++
 measurements/logger.csv | 13 +++++++++++++
 measurements/stages.tsv |  1 +
 run-report.md           | 31 +++++++++++++++++--------------
 8 files changed, 86 insertions(+), 19 deletions(-)

Checklist

  • The diff touches build infra (1 file(s)) — see Files above; deliberate for this stage.
  • measurements/logger.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: 3 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 application-level syslog initialization during startup.
    • Added access to the shared logger for application tasks.
  • Documentation

    • Updated stage descriptions and resource-cost figures to reflect logger creation.
    • Refreshed run reports, memory measurements, and self-check results for the logger configuration.

The logger is created with both collaborators absent, deliberately. Create never
fails and never returns NULL — a missing collaborator is substituted with its
Null object — so the only evidence is what the handler prints, and the run report
now carries three of them:

  [syslog] CRITICAL SolidSyslog bad-config (detail 1)
  [syslog] CRITICAL SolidSyslog bad-config (detail 2)
  [syslog] CRITICAL SolidSyslog bad-config (detail 3)

  Flash  +1,036 B
  RAM      +180 B

Doing it in this order is the point. An integrator who wires everything at once
and sees nothing cannot tell a working logger from a silent one; seeing the
faults first, and then watching them go quiet as collaborators arrive, is the
difference between believing it works and knowing.

NULL is "not supplied" and is reported. A collaborator deliberately done without
is passed as its Null object instead — the library tells those two apart, and so
should anyone reading this wiring later.

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be39c956-4a05-4d5f-a264-28ca3c381c54

📥 Commits

Reviewing files that changed from the base of the PR and between c2c95ea and 1226a34.

⛔ Files ignored due to path filters (2)
  • measurements/logger.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/Syslog.c
  • app/syslog/Syslog.h
  • run-report.md

📝 Walkthrough

Walkthrough

The application adds a syslog wrapper that creates an empty SolidSyslog instance, compiles it into the baseline executable, starts it during initialization, and documents updated logger-stage measurements.

Changes

Logger creation wiring

Layer / File(s) Summary
Syslog API and empty instance creation
app/syslog/Syslog.h, app/syslog/Syslog.c
Defines the opaque logger API, creates SolidSyslog with null buffer and sender collaborators, and exposes its shared handle.
Build and startup integration
CMakeLists.txt, app/main.c
Adds Syslog.c to the baseline executable and calls Syslog_Start() after installing the error handler.
Stage documentation and run measurements
README.md, run-report.md
Renames the documented stage to “Logger created” and updates cost, size, scenario, and self-check values.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant main
  participant Syslog
  participant SolidSyslog
  main->>Syslog: Syslog_Start()
  Syslog->>SolidSyslog: SolidSyslog_Create(config)
  SolidSyslog-->>Syslog: shared logger instance
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: creating the logger with no collaborators wired in.
Description check ✅ Passed The description matches the template structure and includes the required stage summary and checklist items.
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.
✨ 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/logger

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

@DavidCozens
DavidCozens merged commit c1b59ec into main Jul 29, 2026
2 checks passed
@DavidCozens
DavidCozens deleted the stage/logger branch July 29, 2026 14:37
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