Skip to content

Commit 6dd28f7

Browse files
committed
better types
1 parent ad39866 commit 6dd28f7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

packages/pino-transport/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,19 @@ const logger = pino(transport);
8484

8585
The transport accepts the following options:
8686

87-
### `levels`
87+
### `logLevels`
8888

8989
**Type:** `Array<'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'>`
90-
**Default:** `['trace', 'debug', 'info', 'warn', 'error', 'fatal']` (all levels)
9190

92-
Use this option to filter which log levels should be sent to Sentry.
91+
**Default:** `['trace', 'debug', 'info', 'warn', 'error', 'fatal']` (all log levels)
92+
93+
Use this option to filter which log severity levels should be sent to Sentry.
9394

9495
```javascript
9596
const transport = pino.transport({
9697
target: '@sentry/pino-transport',
9798
options: {
98-
levels: ['warn', 'error', 'fatal'], // Only send warnings and above
99+
logLevels: ['warn', 'error', 'fatal'], // Only send warnings and above
99100
},
100101
});
101102
```

packages/pino-transport/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { LogSeverityLevel } from '@sentry/core';
22
import { _INTERNAL_captureLog, isPrimitive, normalize } from '@sentry/core';
3+
import type buildType from 'pino-abstract-transport';
34
import * as pinoAbstractTransport from 'pino-abstract-transport';
45

56
// Handle both CommonJS and ES module exports
@@ -109,8 +110,7 @@ interface PinoSourceConfig {
109110
* logger.error('Something went wrong');
110111
* ```
111112
*/
112-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
113-
export function createSentryPinoTransport(options?: SentryPinoTransportOptions) {
113+
export function createSentryPinoTransport(options?: SentryPinoTransportOptions): ReturnType<typeof buildType> {
114114
const capturedLogLevels = new Set(options?.logLevels ?? DEFAULT_CAPTURED_LEVELS);
115115

116116
return build(

0 commit comments

Comments
 (0)