1
1
import type { Integration , Options , Scope , Span } from '@sentry/core' ;
2
2
import {
3
3
applySdkMetadata ,
4
- logger ,
4
+ debug ,
5
5
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ,
6
6
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ,
7
7
} from '@sentry/core' ;
@@ -127,7 +127,7 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
127
127
const handlerDesc = basename ( handlerPath ) ;
128
128
const match = handlerDesc . match ( / ^ ( [ ^ . ] * ) \. ( .* ) $ / ) ;
129
129
if ( ! match ) {
130
- DEBUG_BUILD && logger . error ( `Bad handler ${ handlerDesc } ` ) ;
130
+ DEBUG_BUILD && debug . error ( `Bad handler ${ handlerDesc } ` ) ;
131
131
return ;
132
132
}
133
133
@@ -138,7 +138,7 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
138
138
const handlerDir = handlerPath . substring ( 0 , handlerPath . indexOf ( handlerDesc ) ) ;
139
139
obj = tryRequire ( taskRoot , handlerDir , handlerMod ) ;
140
140
} catch ( e ) {
141
- DEBUG_BUILD && logger . error ( `Cannot require ${ handlerPath } in ${ taskRoot } ` , e ) ;
141
+ DEBUG_BUILD && debug . error ( `Cannot require ${ handlerPath } in ${ taskRoot } ` , e ) ;
142
142
return ;
143
143
}
144
144
@@ -150,17 +150,17 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
150
150
functionName = name ;
151
151
} ) ;
152
152
if ( ! obj ) {
153
- DEBUG_BUILD && logger . error ( `${ handlerPath } is undefined or not exported` ) ;
153
+ DEBUG_BUILD && debug . error ( `${ handlerPath } is undefined or not exported` ) ;
154
154
return ;
155
155
}
156
156
if ( typeof obj !== 'function' ) {
157
- DEBUG_BUILD && logger . error ( `${ handlerPath } is not a function` ) ;
157
+ DEBUG_BUILD && debug . error ( `${ handlerPath } is not a function` ) ;
158
158
return ;
159
159
}
160
160
161
161
// Check for prototype pollution
162
162
if ( functionName === '__proto__' || functionName === 'constructor' || functionName === 'prototype' ) {
163
- DEBUG_BUILD && logger . error ( `Invalid handler name: ${ functionName } ` ) ;
163
+ DEBUG_BUILD && debug . error ( `Invalid handler name: ${ functionName } ` ) ;
164
164
return ;
165
165
}
166
166
@@ -317,7 +317,7 @@ export function wrapHandler<TEvent, TResult>(
317
317
span . end ( ) ;
318
318
}
319
319
await flush ( options . flushTimeout ) . catch ( e => {
320
- DEBUG_BUILD && logger . error ( e ) ;
320
+ DEBUG_BUILD && debug . error ( e ) ;
321
321
} ) ;
322
322
}
323
323
return rv ;
0 commit comments