@@ -105,7 +105,7 @@ export abstract class BaseTransport implements Transport {
105105 // A correct type for map-based implementation if we want to go that route
106106 // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
107107 const key = `${ requestTypeToCategory ( category ) } :${ reason } ` ;
108- logger . log ( `Adding outcome: ${ key } ` ) ;
108+ isDebugBuild ( ) && logger . log ( `Adding outcome: ${ key } ` ) ;
109109 this . _outcomes [ key ] = ( this . _outcomes [ key ] ?? 0 ) + 1 ;
110110 }
111111
@@ -122,11 +122,11 @@ export abstract class BaseTransport implements Transport {
122122
123123 // Nothing to send
124124 if ( ! Object . keys ( outcomes ) . length ) {
125- logger . log ( 'No outcomes to flush' ) ;
125+ isDebugBuild ( ) && logger . log ( 'No outcomes to flush' ) ;
126126 return ;
127127 }
128128
129- logger . log ( `Flushing outcomes:\n${ JSON . stringify ( outcomes , null , 2 ) } ` ) ;
129+ isDebugBuild ( ) && logger . log ( `Flushing outcomes:\n${ JSON . stringify ( outcomes , null , 2 ) } ` ) ;
130130
131131 const url = getEnvelopeEndpointWithUrlEncodedAuth ( this . _api . dsn , this . _api . tunnel ) ;
132132
@@ -144,7 +144,7 @@ export abstract class BaseTransport implements Transport {
144144 try {
145145 sendReport ( url , serializeEnvelope ( envelope ) ) ;
146146 } catch ( e ) {
147- logger . error ( e ) ;
147+ isDebugBuild ( ) && logger . error ( e ) ;
148148 }
149149 }
150150
@@ -170,8 +170,9 @@ export abstract class BaseTransport implements Transport {
170170 * https://developer.mozilla.org/en-US/docs/Web/API/Headers/get
171171 */
172172 const limited = this . _handleRateLimit ( headers ) ;
173- if ( limited && isDebugBuild ( ) ) {
174- logger . warn ( `Too many ${ requestType } requests, backing off until: ${ this . _disabledUntil ( requestType ) } ` ) ;
173+ if ( limited ) {
174+ isDebugBuild ( ) &&
175+ logger . warn ( `Too many ${ requestType } requests, backing off until: ${ this . _disabledUntil ( requestType ) } ` ) ;
175176 }
176177
177178 if ( status === 'success' ) {
0 commit comments