Skip to content

Commit

Permalink
remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
RafalSumislawski committed Jul 11, 2024
1 parent 95698b7 commit b3f1902
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
path: ${{ env.OPENTELEMETRY_JS_CONTRIB_PATH }}
repository: coralogix/opentelemetry-js-contrib
ref: refs/heads/troubleshooting
ref: refs/heads/coralogix-autoinstrumentation
ssh-key: ${{ secrets.OPENTELEMETRY_CI_GITHUB_KEY }}
- uses: actions/checkout@v3
with:
Expand Down
12 changes: 0 additions & 12 deletions nodejs/packages/cx-wrapper/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,43 +41,31 @@ export const handler = (event: any, context: Context, callback: Callback) => {
const patchedHandler = lambdaInstrumentation.getPatchHandler(originalHandler) as any as Handler;
diag.debug(`Running CX handler and redirecting to ${process.env.CX_ORIGINAL_HANDLER}`)
const maybePromise = patchedHandler(event, context, callback);
diag.debug(`patchedHandler returned`);
if (typeof maybePromise?.then === 'function') {
diag.debug(`maybePromise is a promise`);
maybePromise.then(
value => {
diag.debug(`maybePromise succeeded`);
context.callbackWaitsForEmptyEventLoop = false;
callback(null, value);
diag.debug(`callback called`);
},
(err: Error | string | null | undefined) => {
if (err === undefined || err === null) {
diag.debug(`maybePromise failed with no error`);
context.callbackWaitsForEmptyEventLoop = false;
callback('handled', null);
diag.debug(`callback called`);
} else {
diag.debug(`maybePromise failed`);
context.callbackWaitsForEmptyEventLoop = false;
callback(err, null);
diag.debug(`callback called`);
}
}
);
}
} catch (err: any) {
diag.debug(`handler failed synchronously`);
context.callbackWaitsForEmptyEventLoop = false;
callback(err, null);
diag.debug(`callback called`);
}
},
(err: Error | string) => {
diag.debug(`loading function failed`);
context.callbackWaitsForEmptyEventLoop = false;
callback(err, null)
diag.debug(`callback called`);
}
);
}
Expand Down

0 comments on commit b3f1902

Please sign in to comment.