Skip to content

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

Merged
DavidCozens merged 1 commit into
mainfrom
stage-03-logger
Aug 16, 2026
Merged

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

Conversation

@DavidCozens

@DavidCozens DavidCozens commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Create the logger with both collaborators absent, deliberately, and read what the handler prints.

struct SolidSyslogConfig config = {
    .Buffer = NULL,
    .Sender = NULL,
};

struct SolidSyslog* logger = SolidSyslog_Create(&config);

No _Create fails or returns NULL — a missing collaborator is substituted with its Null object
and reported — so the only evidence is what the handler says:

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

Three, for the buffer, the sender and the store. Each names the collaborator in Detail, as a
value of the emitting class's own error enum.

The order matters. Wire everything at once and see nothing, and you cannot tell a working logger
from a silent one. Seeing the faults first, then watching them go quiet as each collaborator
arrives, is the difference between believing it works and knowing.

A convention worth adopting now: NULL as a parameter means "not supplied" and is reported, while
a collaborator you have deliberately done without is passed as its Null object. The library
distinguishes the two, and so should anyone reading the wiring later.

Syslog.c is introduced here as the one place that knows how the logger is assembled; every later
stage adds to it, and nothing else in the application ever sees a config struct.

Summary by CodeRabbit

  • New Features

    • Added system logging initialization during application startup.
    • Added access to the active system logger for application components.
    • The logger now reports configuration issues when optional buffering or message delivery is unavailable.
  • Documentation

    • Updated setup guidance to explain logger creation, collaborator ordering, and null-object behavior.
    • Added logger resource usage measurements and updated flash and RAM estimates.
    • Updated runtime reports with critical syslog records and revised memory metrics.

@DavidCozens

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

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

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: 4283ae85-dbe2-4907-b0df-663af04188c2

📥 Commits

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

⛔ 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 PR adds a Syslog module that creates a SolidSyslog logger without buffer or sender collaborators. It wires logger startup into application initialization, updates the baseline build, and records the logger-stage resource measurements.

Changes

Logger startup

Layer / File(s) Summary
Logger interface and creation
app/syslog/Syslog.h, app/syslog/Syslog.c
Adds Syslog_Start() and Syslog_Handle(). Syslog_Start() creates and stores a SolidSyslog instance with absent buffer and sender collaborators.
Application and build wiring
CMakeLists.txt, app/main.c
Adds the Syslog source and include path to the baseline target. Calls Syslog_Start() after installing the syslog error handler.
Documentation and run measurements
README.md, run-report.md
Documents the logger-created stage, diagnostics, wiring order, resource cost, logger records, and updated measurement checks.

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

Merge Risk: ⚪ Minimal · up to 9c080

The logger wiring change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant Application
  participant Syslog
  participant SolidSyslog
  Application->>Syslog: Syslog_Start()
  Syslog->>SolidSyslog: SolidSyslog_Create(Buffer unset, Sender unset)
  SolidSyslog-->>Syslog: Return logger handle
  Syslog-->>Application: Store logger handle
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 logger behavior but omits the required headings and all checklist confirmations. Add the required sections and confirm the measurement files, README regeneration, and successful ./run.sh execution.
✅ 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 identifies the logger creation and its deliberate absence of collaborators.
✨ 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-03-logger

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
DavidCozens force-pushed the stage-02-error-handler branch from 0b1af20 to c481c5c Compare August 16, 2026 17:56
@DavidCozens

Copy link
Copy Markdown
Contributor Author

@coderabbitai pause

Base automatically changed from stage-02-error-handler to main August 16, 2026 17:56
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,052 B
  RAM      +184 B

One each for the buffer, the sender and the store, named in Detail as values of
the emitting class's own error enum.

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>
@DavidCozens
DavidCozens merged commit 177430f into main Aug 16, 2026
2 checks passed
@DavidCozens
DavidCozens deleted the stage-03-logger 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