@@ -131,13 +131,12 @@ export function newLogger(options) {
131
131
info : ( message ) => {
132
132
childLogger . info ( { message } ) ;
133
133
134
- if ( ! _compasSentryExport . getActiveSpan ( ) ) {
134
+ if ( ! _compasSentryExport ? .getActiveSpan ?. ( ) ) {
135
135
// Don't add breadcrumbs if we don't have a span. This prevents unmatched logs from showing up in a random span.
136
136
return ;
137
137
}
138
138
139
139
if ( ! addedContextAsBreadcrumb ) {
140
- // @ts -expect-error
141
140
_compasSentryExport . addBreadcrumb ( {
142
141
category : context . type ,
143
142
data : {
@@ -149,7 +148,6 @@ export function newLogger(options) {
149
148
addedContextAsBreadcrumb = true ;
150
149
}
151
150
152
- // @ts -expect-error
153
151
_compasSentryExport . addBreadcrumb ( {
154
152
category : context . type ,
155
153
data : typeof message === "string" ? undefined : message ,
@@ -161,13 +159,12 @@ export function newLogger(options) {
161
159
error : ( message ) => {
162
160
childLogger . error ( { message } ) ;
163
161
164
- if ( ! _compasSentryExport . getActiveSpan ( ) ) {
162
+ if ( ! _compasSentryExport ? .getActiveSpan ?. ( ) ) {
165
163
// Don't add breadcrumbs if we don't have a span. This prevents unmatched logs from showing up in a random span.
166
164
return ;
167
165
}
168
166
169
167
if ( ! addedContextAsBreadcrumb ) {
170
- // @ts -expect-error
171
168
_compasSentryExport . addBreadcrumb ( {
172
169
category : "log" ,
173
170
data : {
@@ -179,7 +176,6 @@ export function newLogger(options) {
179
176
addedContextAsBreadcrumb = true ;
180
177
}
181
178
182
- // @ts -expect-error
183
179
_compasSentryExport . addBreadcrumb ( {
184
180
category : "log" ,
185
181
data : typeof message === "string" ? undefined : message ,
0 commit comments