@@ -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 }
@@ -866,12 +866,12 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
866866
867867 if ( this . _isEnabled ( ) && this . _transport ) {
868868 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 ) ;
870870 return reason ;
871871 } ) ;
872872 }
873873
874- DEBUG_BUILD && logger . error ( 'Transport disabled' ) ;
874+ DEBUG_BUILD && debug . error ( 'Transport disabled' ) ;
875875
876876 return resolvedSyncPromise ( { } ) ;
877877 }
@@ -1021,7 +1021,7 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
10211021 isolationScope = getIsolationScope ( ) ,
10221022 ) : PromiseLike < string | undefined > {
10231023 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>' } \`` ) ;
10251025 }
10261026
10271027 return this . _processEvent ( event , hint , currentScope , isolationScope ) . then (
@@ -1031,11 +1031,11 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
10311031 reason => {
10321032 if ( DEBUG_BUILD ) {
10331033 if ( _isDoNotSendEventError ( reason ) ) {
1034- logger . log ( reason . message ) ;
1034+ debug . log ( reason . message ) ;
10351035 } else if ( _isInternalError ( reason ) ) {
1036- logger . warn ( reason . message ) ;
1036+ debug . warn ( reason . message ) ;
10371037 } else {
1038- logger . warn ( reason ) ;
1038+ debug . warn ( reason ) ;
10391039 }
10401040 }
10411041 return undefined ;
@@ -1196,22 +1196,22 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
11961196 * Sends client reports as an envelope.
11971197 */
11981198 protected _flushOutcomes ( ) : void {
1199- DEBUG_BUILD && logger . log ( 'Flushing outcomes...' ) ;
1199+ DEBUG_BUILD && debug . log ( 'Flushing outcomes...' ) ;
12001200
12011201 const outcomes = this . _clearOutcomes ( ) ;
12021202
12031203 if ( outcomes . length === 0 ) {
1204- DEBUG_BUILD && logger . log ( 'No outcomes to send' ) ;
1204+ DEBUG_BUILD && debug . log ( 'No outcomes to send' ) ;
12051205 return ;
12061206 }
12071207
12081208 // This is really the only place where we want to check for a DSN and only send outcomes then
12091209 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' ) ;
12111211 return ;
12121212 }
12131213
1214- DEBUG_BUILD && logger . log ( 'Sending outcomes:' , outcomes ) ;
1214+ DEBUG_BUILD && debug . log ( 'Sending outcomes:' , outcomes ) ;
12151215
12161216 const envelope = createClientReportEnvelope ( outcomes , this . _options . tunnel && dsnToString ( this . _dsn ) ) ;
12171217
0 commit comments