Skip to content

Commit

Permalink
test: add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaDiotallevi committed Aug 12, 2024
1 parent 1edf632 commit 58df395
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/apiProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ export const proxyApiHandler =
// tslint:disable-next-line:no-object-mutation
res.locals.loggingDetail.status = intermediateResponse.status;
// tslint:disable-next-line:no-object-mutation
console.log('server/apiProxy');
console.log(JSON.stringify(res));
res.locals.loggingDetail.isOK = intermediateResponse.ok;

res.status(intermediateResponse.status);
Expand Down Expand Up @@ -167,6 +169,8 @@ export const proxyApiHandler =
return intermediateResponse.buffer();
})
.then((body) => {
console.log('apiProxy - body');
console.log(JSON.stringify(res));
const suitableLog = res.locals.loggingDetail.isOK
? log.info
: log.warn;
Expand Down
2 changes: 2 additions & 0 deletions server/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const putMetric = (fields: MetricLoggingFields) => {
if (process.env.RUNNING_IN_CYPRESS === 'true') {
return;
}
console.log('putMetric');
console.log(JSON.stringify(fields));
const dimensions = {
Stage: conf.STAGE,
outcome: fields.isOK ? 'SUCCESS' : 'ERROR',
Expand Down
4 changes: 4 additions & 0 deletions server/stripeSetupIntentsHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export const stripeSetupIntentHandler = async (
response.locals.loggingDetail.status =
stripeResponse.status;
// tslint:disable-next-line:no-object-mutation
console.log('stripeSetuoIntents');
console.log(JSON.stringify(response));
response.locals.loggingDetail.isOK = stripeResponse.ok;

if (stripeResponse.ok) {
Expand All @@ -102,6 +104,8 @@ export const stripeSetupIntentHandler = async (
}
})
.then((setupIntent: StripeSetupIntent) => {
console.log('setupIntent');
console.log(JSON.stringify(response));
const suitableLog = response.locals.loggingDetail.isOK
? log.info
: log.warning;
Expand Down

0 comments on commit 58df395

Please sign in to comment.