2.3 KiB
2.3 KiB
Tasks: logger-silent-failure-fix
1. Spec delta
- 1.1 Author
specs/logging/spec.mddelta with## MODIFIED Requirements(LG-11, LG-12, LG-13) and## ADDED Requirements(LG-21 sink dispatch isolation, LG-22 BufferedSink no-deadlock, LG-23 MultiSink fan-out, LG-24 generic Logger, LG-25 concrete loggers, LG-26 lifecycle controls, LG-27 Sensitive envelope). - 1.2 Add
**Verified by:**line to every existing LG-NN requirement in the folded spec on fold.
2. Implementation
- 2.1 Add
fallbackSink?: SinktoAbstractLoggerConfig; default to a sink that writes failure records viaconsole.error. - 2.2 Replace
dispatchToSinksbody with per-sink try/catch that emitsLoggerError(LOGGER.SINK)tofallbackSink, incrementsdroppedBySinkError, fireslogger.dropped_total{reason:"sink_error"}, and continues to remaining sinks. - 2.3 Add
droppedBySinkError: numbertoLoggerMetricsand initialise infreshMetrics. - 2.4 Replace
BufferedSinkblock-policy waiter list with inline-drain on overflow; throwLoggerError(LOGGER.CONFIG)on non-positivemaxQueueSize. - 2.5 Update affected unit / conformance tests.
3. Conformance test
- 3.1 Add
packages/observability/logger/src/conformance.spec-conformance.test.tspinning:- sink throw is captured into
fallbackSinkwith codeLOGGER.SINKand incrementsdroppedBySinkError; - sink rejection is captured into
fallbackSinkand incrementsdroppedBySinkError; - the second sink in a list still receives the record when the first throws (per-sink isolation);
BufferedSink({ overflowPolicy: "block", maxQueueSize: 1 })makes forward progress without an externalflush();BufferedSink({ maxQueueSize: 0 })throwsLoggerError(LOGGER.CONFIG)at construction;MultiSink([a,b])writes to bothaandbin parallel.
- sink throw is captured into
4. Gate
- 4.1
bunx turbo lint typecheck test --filter=@suaveplan/loggergreen. - 4.2
bunx turbo test:coverage --filter=@suaveplan/logger100/100/100/100. - 4.3
bun scripts/openspec-conformance.ts @suaveplan/loggerexits 0.
5. Fold + archive
- 5.1 Fold delta into
openspec/specs/logging/spec.md. - 5.2 Move
openspec/changes/logger-silent-failure-fix/toopenspec/archive/2026-04-27-logger-silent-failure-fix/.