feat!: API options object support to control sentry handling; removal of logger.sentry.
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/publish Pipeline was successful

# Conflicts:
#	README.md
#	src/logger.ts
#	src/sinks/sentry.ts
#	test/logger.test.ts
This commit is contained in:
2026-08-07 12:10:38 -03:00
parent 6bee3a801d
commit 234226e2bb
5 changed files with 16 additions and 20 deletions
+10 -10
View File
@@ -101,12 +101,12 @@ The Sentry adapter has **no SDK dependency**. Provide the SDK your application a
Destination policy when `sentry` is configured and `sinks` is not:
| Runtime + environment | Console | Sentry |
| ---------------------- | ------------------------------- | ------------------------------------------- |
| Production **browser** | Off | Issues for errors; optional Logs |
| Production **Node** | On (stderr for errors) | Issues for errors; optional Logs |
| Staging | On (default `warn`+) | Issues for errors; optional Logs |
| Development | On | Nothing |
| Runtime + environment | Console | Sentry |
| ---------------------- | ---------------------- | -------------------------------- |
| Production **browser** | Off | Issues for errors; optional Logs |
| Production **Node** | On (stderr for errors) | Issues for errors; optional Logs |
| Staging | On (default `warn`+) | Issues for errors; optional Logs |
| Development | On | Nothing |
### Issues vs Logs
@@ -143,10 +143,10 @@ logger.info("investigating", { orderId }, { sentry: true }); // force Logs
logger.error("expected", err, { suppressSentry: true }); // console only (when enabled)
```
| Option | Effect |
| ----------------- | ---------------------------------------------------------------------- |
| `sentry: true` | Force this event to Sentry Logs (ignores Logs threshold; not for errors) |
| `suppressSentry: true` | Skip creating a Sentry Issue for an error |
| Option | Effect |
| ---------------------- | ------------------------------------------------------------------------ |
| `sentry: true` | Force this event to Sentry Logs (ignores Logs threshold; not for errors) |
| `suppressSentry: true` | Skip creating a Sentry Issue for an error |
A last argument is treated as options only when every key is `sentry` or `suppressSentry`. Prefer the third-argument form when you also pass data.