Skip to content

Commit

Permalink
remove logger from helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
aloftus23 committed May 9, 2024
1 parent 260c2cc commit 9ee3651
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions backend/src/api/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { plainToClass } from 'class-transformer';
import S3Client from '../tasks/s3-client';
import { SES } from 'aws-sdk';
import * as nodemailer from 'nodemailer';
import logger from '../tools/lambda-logger';
import * as handlebars from 'handlebars';

export const REGION_STATE_MAP = {
Expand Down Expand Up @@ -122,11 +121,11 @@ export const wrapHandler: WrapHandler =
)) as APIGatewayProxyResult;
const resp = makeResponse(event, result);
if (typeof jest === 'undefined') {
logger.info(`=> ${resp.statusCode} ${event.path} `);
console.log(`=> ${resp.statusCode} ${event.path} `);
}
return resp;
} catch (e) {
logger.error(e);
console.error(e);
return makeResponse(event, {
statusCode: Array.isArray(e) ? 400 : 500
});
Expand Down Expand Up @@ -163,10 +162,10 @@ export const sendEmail = async (
replyTo: process.env.CROSSFEED_SUPPORT_EMAIL_REPLYTO!
});

logger.info('Email sent successfully');
console.log('Email sent successfully');
return 'Email sent successfully';
} catch (error) {
logger.error(`Error sending email: ${error}`);
console.error(`Error sending email: ${error}`);

// Handle the error or re-throw it if needed
throw error;
Expand Down

0 comments on commit 9ee3651

Please sign in to comment.