feat!: API options object support to control sentry handling; removal of logger.sentry.
# Conflicts: # README.md # src/logger.ts # src/sinks/sentry.ts # test/logger.test.ts
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user