Skip to content

Commit 78b8e4b

Browse files
authored
ref(aws-serverless): Use debug instead of logger (#17030)
resolves #16953
1 parent 0b9a346 commit 78b8e4b

File tree

1 file changed

+7
-7
lines changed
  • packages/aws-serverless/src

1 file changed

+7
-7
lines changed

packages/aws-serverless/src/sdk.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Integration, Options, Scope, Span } from '@sentry/core';
22
import {
33
applySdkMetadata,
4-
logger,
4+
debug,
55
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
66
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
77
} from '@sentry/core';
@@ -127,7 +127,7 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
127127
const handlerDesc = basename(handlerPath);
128128
const match = handlerDesc.match(/^([^.]*)\.(.*)$/);
129129
if (!match) {
130-
DEBUG_BUILD && logger.error(`Bad handler ${handlerDesc}`);
130+
DEBUG_BUILD && debug.error(`Bad handler ${handlerDesc}`);
131131
return;
132132
}
133133

@@ -138,7 +138,7 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
138138
const handlerDir = handlerPath.substring(0, handlerPath.indexOf(handlerDesc));
139139
obj = tryRequire(taskRoot, handlerDir, handlerMod);
140140
} catch (e) {
141-
DEBUG_BUILD && logger.error(`Cannot require ${handlerPath} in ${taskRoot}`, e);
141+
DEBUG_BUILD && debug.error(`Cannot require ${handlerPath} in ${taskRoot}`, e);
142142
return;
143143
}
144144

@@ -150,17 +150,17 @@ export function tryPatchHandler(taskRoot: string, handlerPath: string): void {
150150
functionName = name;
151151
});
152152
if (!obj) {
153-
DEBUG_BUILD && logger.error(`${handlerPath} is undefined or not exported`);
153+
DEBUG_BUILD && debug.error(`${handlerPath} is undefined or not exported`);
154154
return;
155155
}
156156
if (typeof obj !== 'function') {
157-
DEBUG_BUILD && logger.error(`${handlerPath} is not a function`);
157+
DEBUG_BUILD && debug.error(`${handlerPath} is not a function`);
158158
return;
159159
}
160160

161161
// Check for prototype pollution
162162
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}`);
164164
return;
165165
}
166166

@@ -317,7 +317,7 @@ export function wrapHandler<TEvent, TResult>(
317317
span.end();
318318
}
319319
await flush(options.flushTimeout).catch(e => {
320-
DEBUG_BUILD && logger.error(e);
320+
DEBUG_BUILD && debug.error(e);
321321
});
322322
}
323323
return rv;

0 commit comments

Comments
 (0)