Decision record · logging
swm-logs or Pino for Node.js?
Short answer
Choose swm-logs when zero runtime dependencies, a small ESM API, and application-owned delivery are hard requirements. Choose Pino when a mature transport ecosystem, worker-based processing, and compatibility with existing Pino integrations matter more.
- 0.1.1
- swm-logs
- 0
- runtime deps
- 22 / 24
- Node.js
Scope
This comparison fixes @swarmmachina/swm-logs at 0.1.1 and the Pino transport model at 10.1.0. swm-logs is still experimental and is not a drop-in Pino replacement.
Engineering comparison of swm-logs and Pino
| Criterion | swm-logs 0.1.1 | Pino 10.1.0 |
|---|---|---|
| Stage | An experimental package with an intentionally small surface. | A mature project with an established integration ecosystem. |
| Runtime surface | Native ESM for Node.js 22/24 with no third-party runtime dependencies. | Its own package and integration surface; verify it for the selected release. |
| Format | One NDJSON record per event; numeric levels are Pino-compatible. | Structured JSON using the familiar Pino level model. |
| Delivery | Synchronous callback transport; queues, retries, and persistence belong to the application. | The official transport API supports worker threads, targets, and pipelines. |
| Backpressure | Immediate mode uses the Node.js stream queue; strict bounds require a custom bounded transport. | Behavior depends on the selected destination or transport and its configuration. |
| Migration | base → bindings, custom levels → log(); workers, pretty output, and vendor transports are not bundled. | Prefer it when the application already depends on Pino APIs or transports. |
Decide from constraints
- 01
A minimal production surface is required
Consider swm-logsWhen Node.js 22/24 and application-owned delivery are already accepted constraints.
- 02
Ready-made external transports are required
Stay with PinoIts worker transport API and accumulated ecosystem outweigh a smaller surface.
- 03
A drop-in migration is required
Do not swap packages blindlyLevels are compatible, but the full API, transport lifecycle, and extension set are not.
What this comparison does not claim
- This is a contract comparison, not a universal performance ranking.
- swm-logs does not bundle file rotation, pretty printing, network exporters, or vendor SDKs.
- Before migrating, test serializers, redaction paths, the crash path, and delivery guarantees.
Primary sources
Versions and claims can be checked directly against fixed source snapshots.