@@ -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
}
@@ -877,12 +877,12 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
877
877
878
878
if ( this . _isEnabled ( ) && this . _transport ) {
879
879
return this . _transport . send ( envelope ) . then ( null , reason => {
880
- DEBUG_BUILD && logger . error ( 'Error while sending envelope:' , reason ) ;
880
+ DEBUG_BUILD && debug . error ( 'Error while sending envelope:' , reason ) ;
881
881
return reason ;
882
882
} ) ;
883
883
}
884
884
885
- DEBUG_BUILD && logger . error ( 'Transport disabled' ) ;
885
+ DEBUG_BUILD && debug . error ( 'Transport disabled' ) ;
886
886
887
887
return resolvedSyncPromise ( { } ) ;
888
888
}
@@ -1032,7 +1032,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
1032
1032
isolationScope = getIsolationScope ( ) ,
1033
1033
) : PromiseLike < string | undefined > {
1034
1034
if ( DEBUG_BUILD && isErrorEvent ( event ) ) {
1035
- logger . log ( `Captured error event \`${ getPossibleEventMessages ( event ) [ 0 ] || '<unknown>' } \`` ) ;
1035
+ debug . log ( `Captured error event \`${ getPossibleEventMessages ( event ) [ 0 ] || '<unknown>' } \`` ) ;
1036
1036
}
1037
1037
1038
1038
return this . _processEvent ( event , hint , currentScope , isolationScope ) . then (
@@ -1042,11 +1042,11 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
1042
1042
reason => {
1043
1043
if ( DEBUG_BUILD ) {
1044
1044
if ( _isDoNotSendEventError ( reason ) ) {
1045
- logger . log ( reason . message ) ;
1045
+ debug . log ( reason . message ) ;
1046
1046
} else if ( _isInternalError ( reason ) ) {
1047
- logger . warn ( reason . message ) ;
1047
+ debug . warn ( reason . message ) ;
1048
1048
} else {
1049
- logger . warn ( reason ) ;
1049
+ debug . warn ( reason ) ;
1050
1050
}
1051
1051
}
1052
1052
return undefined ;
@@ -1207,22 +1207,22 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
1207
1207
* Sends client reports as an envelope.
1208
1208
*/
1209
1209
protected _flushOutcomes ( ) : void {
1210
- DEBUG_BUILD && logger . log ( 'Flushing outcomes...' ) ;
1210
+ DEBUG_BUILD && debug . log ( 'Flushing outcomes...' ) ;
1211
1211
1212
1212
const outcomes = this . _clearOutcomes ( ) ;
1213
1213
1214
1214
if ( outcomes . length === 0 ) {
1215
- DEBUG_BUILD && logger . log ( 'No outcomes to send' ) ;
1215
+ DEBUG_BUILD && debug . log ( 'No outcomes to send' ) ;
1216
1216
return ;
1217
1217
}
1218
1218
1219
1219
// This is really the only place where we want to check for a DSN and only send outcomes then
1220
1220
if ( ! this . _dsn ) {
1221
- DEBUG_BUILD && logger . log ( 'No dsn provided, will not send outcomes' ) ;
1221
+ DEBUG_BUILD && debug . log ( 'No dsn provided, will not send outcomes' ) ;
1222
1222
return ;
1223
1223
}
1224
1224
1225
- DEBUG_BUILD && logger . log ( 'Sending outcomes:' , outcomes ) ;
1225
+ DEBUG_BUILD && debug . log ( 'Sending outcomes:' , outcomes ) ;
1226
1226
1227
1227
const envelope = createClientReportEnvelope ( outcomes , this . _options . tunnel && dsnToString ( this . _dsn ) ) ;
1228
1228
0 commit comments