Skip to content

Commit

Permalink
Merge pull request #105 from futurice/remove-unnecessary-logging
Browse files Browse the repository at this point in the history
Remove unnecessary logging from API.
  • Loading branch information
jareware authored Mar 26, 2020
2 parents 53fe09a + 2bf4af8 commit 8455279
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import { assertIs, FrontendResponseModel, FrontendResponseModelT } from './commo
import { prepareResponseForStorage, storeResponseInS3 } from './core/main';

export const apiEntrypoint: APIGatewayProxyHandler = (event, context) => {
console.log(`Incoming request: ${event.httpMethod} ${event.path}`, {
headers: event.headers,
queryString: event.queryStringParameters,
body: event.body,
});
console.log(`Incoming request: ${event.httpMethod} ${event.path}`); // to preserve privacy, don't log any headers, etc
if (event.httpMethod === 'OPTIONS') {
return Promise.resolve().then(() => response(200, undefined));
} else {
Expand Down Expand Up @@ -52,7 +48,7 @@ if (process.argv[0].match(/\/ts-node$/)) {
}

const response = (statusCode: number, body?: object, logError?: Error) => {
console.log(`Outgoing response: ${statusCode}`, { body });
console.log(`Outgoing response: ${statusCode}`);
if (logError) console.error('ERROR', logError);
return {
statusCode,
Expand Down

0 comments on commit 8455279

Please sign in to comment.