Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Fix logging statements that are always printed even when debug is not… #59

Merged
merged 1 commit into from
Jan 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export interface S3Config {
const validateArguments = (s3Config: S3Config, event: S3Event) => {

if (!Array.isArray(event.Records) || event.Records.length < 1 || event.Records[0].eventSource !== 'aws:s3') {
console.log('Event does not look like S3')
if (s3Config.debug) {
console.log('Event does not look like S3')
}
return false
}

Expand Down
4 changes: 3 additions & 1 deletion lib/sns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const process: ProcessMethod<SnsConfig, SnsEvent, Context, any> = (snsCon
}

if (!Array.isArray(event.Records) || event.Records.length < 1 || !event.Records[0].Sns) {
console.log('Event does not look like SNS')
if(snsConfig.debug) {
console.log('Event does not look like SNS')
}
return null
}

Expand Down
4 changes: 3 additions & 1 deletion lib/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const process: ProcessMethod<SqsConfig, SqsEvent, Context, any> = (sqsCon
}

if (!Array.isArray(event.Records) || event.Records.length < 1 || event.Records[0].eventSource !== 'aws:sqs') {
console.log('Event does not look like SQS')
if(sqsConfig.debug) {
console.log('Event does not look like SQS')
}
return null
}

Expand Down