Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 820dbb3

Browse files
author
Michal Vlasák
committed
♻️ Do not import pino symbol directly
1 parent e55bb5a commit 820dbb3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/sentry.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { captureException, captureMessage, Severity, withScope } from '@sentry/node';
2-
import { streamSym } from 'pino/lib/symbols';
2+
import * as pino from 'pino';
33
import { Cosmas } from '.';
44
import { levels } from './levels';
55

@@ -29,10 +29,10 @@ export const extendSentry = (logger: Cosmas, options: { sentry: string | true; s
2929
sentry.init({ dsn: options.sentry });
3030
}
3131

32-
const originalWrite = logger[streamSym].write;
32+
const originalWrite = logger[(pino as any).symbols.streamSym].write; // TODO: update pino types with symbols
3333
// unfortunately, this is the only place in pino, we can hook onto, where we can be sure all
3434
// the hooks, formatters and serializers are already applied
35-
logger[streamSym].write = function (s: string) {
35+
logger[(pino as any).symbols.streamSym].write = function (s: string) {
3636
originalWrite.call(this, s);
3737
const obj = JSON.parse(s);
3838
if (obj.level < (options.sentryLevel || levels.warn)) return;

0 commit comments

Comments
 (0)