docs: capture todo - Quiet plugin boot logs on console commands like --help

This commit is contained in:
Jakub Zych
2026-10-21 15:34:02 +02:00
parent 99b6df44d6
commit c1f5ded59d

View File

@@ -0,0 +1,41 @@
---
created: 2026-10-21T13:33:21.495Z
title: Quiet plugin boot logs on console commands like --help
area: framework
severity: minor
g15office: izelucbh
files:
- ../sm-demo-app/plugins/golem15/paymentgateway/boot.go:129
- ../sm-demo-app/plugins/golem15/paymentgatewaysubscriptions/boot.go:86
- modules/diary
- modules/bonfire
---
## Problem
Every console command prints the plugins' boot-time INFO records, even `--help`. From sm-demo-app, after phase 19.8 plans 01–03:
```
$ bin/demo serve --help
time=2026-10-21T15:31:35.392+02:00 level=INFO msg="paymentgateway: operators registered" codes="[golem15.paymentgateway::lang.channels.cash golem15.paymentgateway::lang.channels.manualTransfer golem15.pgstripe::lang.operators.stripe]"
time=2026-10-21T15:31:35.394+02:00 level=INFO msg="golem15.paymentgatewaysubscriptions: registries collected" subscriber_types=[user] gateways=[stripe]
Serve the application HTTP API
```
Registration chatter belongs to `serve` (or `-v`), not to `--help`, `list` or a one-off command.
Two causes:
1. sm-paymentgateway-plugin (`boot.go:129`) and sm-paymentgatewaysubscriptions-plugin (`boot.go:86`) log through `slog.Default().Info`, not a diary component logger. That is why the lines are plain slog text (`time=… level=INFO msg=…`) and not diary console output. Plan 19.8-01 moved only the framework modules onto diary components, not the shared plugins.
2. Plugins `Boot` before bonfire dispatches the command, so whatever a plugin logs at Info level during boot shows on every command.
Not critical; found 2026-10-21 during phase 19.8.
## Solution
TBD. Options, possibly combined:
- In the payment plugins, log these records at Debug through `diary.For("<component>")`. These are shared core plugins, so the change must not break anything.
- Check whether diary installs itself as `slog.Default` early enough. If it did, these lines would at least be formatted and levelled through diary.
- Let bonfire handle `--help`, `help` and `list` before plugin `Boot`, or give non-long-running commands a default console level that hides Info boot records unless `-v` is set.
- Sweep the other shared plugins for `slog.Default()` calls in `Register`/`Boot`.