@@ -37,7 +37,7 @@ import { dsnToString, makeDsn } from './utils/dsn';
3737import { addItemToEnvelope , createAttachmentEnvelopeItem } from './utils/envelope' ;
3838import { getPossibleEventMessages } from './utils/eventUtils' ;
3939import { isParameterizedString , isPlainObject , isPrimitive , isThenable } from './utils/is' ;
40- import { logger } from './utils/logger' ;
40+ import { debug } from './utils/logger' ;
4141import { merge } from './utils/merge' ;
4242import { checkOrSetAlreadyCaught , uuid4 } from './utils/misc' ;
4343import { parseSampleRate } from './utils/parseSampleRate' ;
@@ -154,7 +154,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
154154 if ( options . dsn ) {
155155 this . _dsn = makeDsn ( options . dsn ) ;
156156 } 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.' ) ;
158158 }
159159
160160 if ( this . _dsn ) {
@@ -182,7 +182,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
182182
183183 // ensure we haven't captured this very object before
184184 if ( checkOrSetAlreadyCaught ( exception ) ) {
185- DEBUG_BUILD && logger . log ( ALREADY_SEEN_ERROR ) ;
185+ DEBUG_BUILD && debug . log ( ALREADY_SEEN_ERROR ) ;
186186 return eventId ;
187187 }
188188
@@ -237,7 +237,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
237237
238238 // ensure we haven't captured this very object before
239239 if ( hint ?. originalException && checkOrSetAlreadyCaught ( hint . originalException ) ) {
240- DEBUG_BUILD && logger . log ( ALREADY_SEEN_ERROR ) ;
240+ DEBUG_BUILD && debug . log ( ALREADY_SEEN_ERROR ) ;
241241 return eventId ;
242242 }
243243
@@ -429,15 +429,15 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
429429 if ( 'aggregates' in session ) {
430430 const sessionAttrs = session . attrs || { } ;
431431 if ( ! sessionAttrs . release && ! clientReleaseOption ) {
432- DEBUG_BUILD && logger . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
432+ DEBUG_BUILD && debug . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
433433 return ;
434434 }
435435 sessionAttrs . release = sessionAttrs . release || clientReleaseOption ;
436436 sessionAttrs . environment = sessionAttrs . environment || clientEnvironmentOption ;
437437 session . attrs = sessionAttrs ;
438438 } else {
439439 if ( ! session . release && ! clientReleaseOption ) {
440- DEBUG_BUILD && logger . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
440+ DEBUG_BUILD && debug . warn ( MISSING_RELEASE_FOR_SESSION_ERROR ) ;
441441 return ;
442442 }
443443 session . release = session . release || clientReleaseOption ;
@@ -465,7 +465,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
465465 // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
466466 // With typescript 4.1 we could even use template literal types
467467 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)` : '' } ` ) ;
469469 this . _outcomes [ key ] = ( this . _outcomes [ key ] || 0 ) + count ;
470470 }
471471 }
@@ -877,12 +877,12 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
877877
878878 if ( this . _isEnabled ( ) && this . _transport ) {
879879 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 ) ;
881881 return reason ;
882882 } ) ;
883883 }
884884
885- DEBUG_BUILD && logger . error ( 'Transport disabled' ) ;
885+ DEBUG_BUILD && debug . error ( 'Transport disabled' ) ;
886886
887887 return resolvedSyncPromise ( { } ) ;
888888 }
@@ -1032,7 +1032,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
10321032 isolationScope = getIsolationScope ( ) ,
10331033 ) : PromiseLike < string | undefined > {
10341034 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>' } \`` ) ;
10361036 }
10371037
10381038 return this . _processEvent ( event , hint , currentScope , isolationScope ) . then (
@@ -1042,11 +1042,11 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
10421042 reason => {
10431043 if ( DEBUG_BUILD ) {
10441044 if ( _isDoNotSendEventError ( reason ) ) {
1045- logger . log ( reason . message ) ;
1045+ debug . log ( reason . message ) ;
10461046 } else if ( _isInternalError ( reason ) ) {
1047- logger . warn ( reason . message ) ;
1047+ debug . warn ( reason . message ) ;
10481048 } else {
1049- logger . warn ( reason ) ;
1049+ debug . warn ( reason ) ;
10501050 }
10511051 }
10521052 return undefined ;
@@ -1207,22 +1207,22 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
12071207 * Sends client reports as an envelope.
12081208 */
12091209 protected _flushOutcomes ( ) : void {
1210- DEBUG_BUILD && logger . log ( 'Flushing outcomes...' ) ;
1210+ DEBUG_BUILD && debug . log ( 'Flushing outcomes...' ) ;
12111211
12121212 const outcomes = this . _clearOutcomes ( ) ;
12131213
12141214 if ( outcomes . length === 0 ) {
1215- DEBUG_BUILD && logger . log ( 'No outcomes to send' ) ;
1215+ DEBUG_BUILD && debug . log ( 'No outcomes to send' ) ;
12161216 return ;
12171217 }
12181218
12191219 // This is really the only place where we want to check for a DSN and only send outcomes then
12201220 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' ) ;
12221222 return ;
12231223 }
12241224
1225- DEBUG_BUILD && logger . log ( 'Sending outcomes:' , outcomes ) ;
1225+ DEBUG_BUILD && debug . log ( 'Sending outcomes:' , outcomes ) ;
12261226
12271227 const envelope = createClientReportEnvelope ( outcomes , this . _options . tunnel && dsnToString ( this . _dsn ) ) ;
12281228
0 commit comments