Skip to content

Commit ce2f67e

Browse files
committed
chore(stdlib): fix TS issues
1 parent f790e16 commit ce2f67e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/stdlib/src/logger.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,12 @@ export function newLogger(options) {
131131
info: (message) => {
132132
childLogger.info({ message });
133133

134-
if (!_compasSentryExport.getActiveSpan()) {
134+
if (!_compasSentryExport?.getActiveSpan?.()) {
135135
// Don't add breadcrumbs if we don't have a span. This prevents unmatched logs from showing up in a random span.
136136
return;
137137
}
138138

139139
if (!addedContextAsBreadcrumb) {
140-
// @ts-expect-error
141140
_compasSentryExport.addBreadcrumb({
142141
category: context.type,
143142
data: {
@@ -149,7 +148,6 @@ export function newLogger(options) {
149148
addedContextAsBreadcrumb = true;
150149
}
151150

152-
// @ts-expect-error
153151
_compasSentryExport.addBreadcrumb({
154152
category: context.type,
155153
data: typeof message === "string" ? undefined : message,
@@ -161,13 +159,12 @@ export function newLogger(options) {
161159
error: (message) => {
162160
childLogger.error({ message });
163161

164-
if (!_compasSentryExport.getActiveSpan()) {
162+
if (!_compasSentryExport?.getActiveSpan?.()) {
165163
// Don't add breadcrumbs if we don't have a span. This prevents unmatched logs from showing up in a random span.
166164
return;
167165
}
168166

169167
if (!addedContextAsBreadcrumb) {
170-
// @ts-expect-error
171168
_compasSentryExport.addBreadcrumb({
172169
category: "log",
173170
data: {
@@ -179,7 +176,6 @@ export function newLogger(options) {
179176
addedContextAsBreadcrumb = true;
180177
}
181178

182-
// @ts-expect-error
183179
_compasSentryExport.addBreadcrumb({
184180
category: "log",
185181
data: typeof message === "string" ? undefined : message,

0 commit comments

Comments
 (0)