fix(sentry): widen SentryLike so official SDKs assign without adapters
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/push/publish unknown status

This commit is contained in:
2026-08-07 16:05:09 -03:00
parent 19de8db119
commit 3c468dbf44
6 changed files with 507 additions and 10 deletions
+4 -2
View File
@@ -95,7 +95,7 @@ Copy [`env.example`](./env.example) as a starting point for local or container c
## Sentry
The Sentry adapter has **no SDK dependency**. Provide the SDK your application already uses via `@mifi/logger/sentry`.
The Sentry adapter has **no SDK dependency**. Pass your official `@sentry/node`, `@sentry/browser`, or `@sentry/nextjs` module directly to `createSentrySink` — no consumer adapter or cast is required.
**Development never sends to Sentry.** Staging and production attach the sink when `sentry` is configured.
@@ -152,6 +152,8 @@ A last argument is treated as options only when every key is `sentry` or `suppre
Logs payload: string message + flat primitive attributes (including `logger.namespace`). Nested objects are not unfurled.
Issue severities use Sentrys union (`warning`, not logger `warn`). The sink maps `warn``warning` and `trace``debug` for Issues only; Logs keep logger level names (`sentry.logger.warn`).
## Custom sinks
Replace the default destinations entirely with `sinks`:
@@ -182,7 +184,7 @@ When `sinks` is provided, the `sentry` option is not used for default sink selec
| `parseLoggingOverride` | `@mifi/logger` | Parse `debug` / `debug:NS1,NS2` override strings |
| `createSentrySink` | `@mifi/logger/sentry` | Adapter for any Sentry-like SDK |
Types: `Logger`, `LoggerOptions`, `LogLevel`, `LoggerEnvironment`, `LogEvent`, `LogSink`, `LogData`, `LogCallOptions`, and (from `/sentry`) `SentryLike`, `SentryScopeLike`, `SentrySink`, `SentrySinkOptions`.
Types: `Logger`, `LoggerOptions`, `LogLevel`, `LoggerEnvironment`, `LogEvent`, `LogSink`, `LogData`, `LogCallOptions`, and (from `/sentry`) `SentryLike`, `SentryScopeLike`, `SentrySeverityLevel`, `SentrySink`, `SentrySinkOptions`.
Optional destinations live under `src/sinks/` (console, Sentry today; New Relic / Datadog-style adapters can land beside them later). Public import paths stay `@mifi/logger` and `@mifi/logger/sentry`.