@@ -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