@@ -37,7 +37,7 @@ import { dsnToString, makeDsn } from './utils/dsn';
37
37
import { addItemToEnvelope , createAttachmentEnvelopeItem } from './utils/envelope' ;
38
38
import { getPossibleEventMessages } from './utils/eventUtils' ;
39
39
import { isParameterizedString , isPlainObject , isPrimitive , isThenable } from './utils/is' ;
40
- import { logger } from './utils/logger' ;
40
+ import { debug } from './utils/logger' ;
41
41
import { merge } from './utils/merge' ;
42
42
import { checkOrSetAlreadyCaught , uuid4 } from './utils/misc' ;
43
43
import { parseSampleRate } from './utils/parseSampleRate' ;
@@ -154,7 +154,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
154
154
if ( options . dsn ) {
155
155
this . _dsn = makeDsn ( options . dsn ) ;
156
156
} else {
157
- DEBUG_BUILD && logger . warn ( 'No DSN provided, client will not send events.' ) ;
157
+ DEBUG_BUILD && debug . warn ( 'No DSN provided, client will not send events.' ) ;
158
158
}
159
159
160
160
if ( this . _dsn ) {
@@ -182,7 +182,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
182
182
183
183
// ensure we haven't captured this very object before
184
184
if ( checkOrSetAlreadyCaught ( exception ) ) {
185
- DEBUG_BUILD && logger . log ( ALREADY_SEEN_ERROR ) ;
185
+ DEBUG_BUILD && debug . log ( ALREADY_SEEN_ERROR ) ;
186
186
return eventId ;
187
187
}
188
188
@@ -237,7 +237,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
237
237
238
238
// ensure we haven't captured this very object before
239
239
if ( hint ?. originalException && checkOrSetAlreadyCaught ( hint . originalException ) ) {
240
- DEBUG_BUILD && logger . log ( ALREADY_SEEN_ERROR ) ;
240
+ DEBUG_BUILD && debug . log ( ALREADY_SEEN_ERROR ) ;
241
241
return eventId ;
242
242
}
243
243
@@ -429,15 +429,15 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
429
429
if ( 'aggregates' in session ) {
430
430
const sessionAttrs = session . attrs || { } ;
431
431
if ( ! sessionAttrs . release && ! clientReleaseOption ) {
432
- DEBUG_BUILD && logger . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
432
+ DEBUG_BUILD && debug . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
433
433
return ;
434
434
}
435
435
sessionAttrs . release = sessionAttrs . release || clientReleaseOption ;
436
436
sessionAttrs . environment = sessionAttrs . environment || clientEnvironmentOption ;
437
437
session . attrs = sessionAttrs ;
438
438
} else {
439
439
if ( ! session . release && ! clientReleaseOption ) {
440
- DEBUG_BUILD && logger . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
440
+ DEBUG_BUILD && debug . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
441
441
return ;
442
442
}
443
443
session . release = session . release || clientReleaseOption ;
@@ -465,7 +465,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
465
465
// would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
466
466
// With typescript 4.1 we could even use template literal types
467
467
const key = `${ reason } :${ category } ` ;
468
- DEBUG_BUILD && logger . log ( `Recording outcome: "${ key } "${ count > 1 ? ` (${ count } times)` : '' } ` ) ;
468
+ DEBUG_BUILD && debug . log ( `Recording outcome: "${ key } "${ count > 1 ? ` (${ count } times)` : '' } ` ) ;
469
469
this . _outcomes [ key ] = ( this . _outcomes [ key ] || 0 ) + count ;
470
470
}
471
471
}
@@ -866,12 +866,12 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
866
866
867
867
if ( this . _isEnabled ( ) && this . _transport ) {
868
868
return this . _transport . send ( envelope ) . then ( null , reason => {
869
- DEBUG_BUILD && logger . error ( 'Error while sending envelope:' , reason ) ;
869
+ DEBUG_BUILD && debug . error ( 'Error while sending envelope:' , reason ) ;
870
870
return reason ;
871
871
} ) ;
872
872
}
873
873
874
- DEBUG_BUILD && logger . error ( 'Transport disabled' ) ;
874
+ DEBUG_BUILD && debug . error ( 'Transport disabled' ) ;
875
875
876
876
return resolvedSyncPromise ( { } ) ;
877
877
}
@@ -1021,7 +1021,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
1021
1021
isolationScope = getIsolationScope ( ) ,
1022
1022
) : PromiseLike < string | undefined > {
1023
1023
if ( DEBUG_BUILD && isErrorEvent ( event ) ) {
1024
- logger . log ( `Captured error event \`${ getPossibleEventMessages ( event ) [ 0 ] || '<unknown>' } \`` ) ;
1024
+ debug . log ( `Captured error event \`${ getPossibleEventMessages ( event ) [ 0 ] || '<unknown>' } \`` ) ;
1025
1025
}
1026
1026
1027
1027
return this . _processEvent ( event , hint , currentScope , isolationScope ) . then (
@@ -1031,11 +1031,11 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
1031
1031
reason => {
1032
1032
if ( DEBUG_BUILD ) {
1033
1033
if ( _isDoNotSendEventError ( reason ) ) {
1034
- logger . log ( reason . message ) ;
1034
+ debug . log ( reason . message ) ;
1035
1035
} else if ( _isInternalError ( reason ) ) {
1036
- logger . warn ( reason . message ) ;
1036
+ debug . warn ( reason . message ) ;
1037
1037
} else {
1038
- logger . warn ( reason ) ;
1038
+ debug . warn ( reason ) ;
1039
1039
}
1040
1040
}
1041
1041
return undefined ;
@@ -1196,22 +1196,22 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
1196
1196
* Sends client reports as an envelope.
1197
1197
*/
1198
1198
protected _flushOutcomes ( ) : void {
1199
- DEBUG_BUILD && logger . log ( 'Flushing outcomes...' ) ;
1199
+ DEBUG_BUILD && debug . log ( 'Flushing outcomes...' ) ;
1200
1200
1201
1201
const outcomes = this . _clearOutcomes ( ) ;
1202
1202
1203
1203
if ( outcomes . length === 0 ) {
1204
- DEBUG_BUILD && logger . log ( 'No outcomes to send' ) ;
1204
+ DEBUG_BUILD && debug . log ( 'No outcomes to send' ) ;
1205
1205
return ;
1206
1206
}
1207
1207
1208
1208
// This is really the only place where we want to check for a DSN and only send outcomes then
1209
1209
if ( ! this . _dsn ) {
1210
- DEBUG_BUILD && logger . log ( 'No dsn provided, will not send outcomes' ) ;
1210
+ DEBUG_BUILD && debug . log ( 'No dsn provided, will not send outcomes' ) ;
1211
1211
return ;
1212
1212
}
1213
1213
1214
- DEBUG_BUILD && logger . log ( 'Sending outcomes:' , outcomes ) ;
1214
+ DEBUG_BUILD && debug . log ( 'Sending outcomes:' , outcomes ) ;
1215
1215
1216
1216
const envelope = createClientReportEnvelope ( outcomes , this . _options . tunnel && dsnToString ( this . _dsn ) ) ;
1217
1217
0 commit comments