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

Commit

Permalink
add log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ste-xx committed Jun 11, 2018
1 parent ae6e6b3 commit feaf7de
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ exports.handler = async (event) => {
}]
} = event;

console.log(`Incoming file: ${bucketName}/${key}`);

let fbFn = {
processApiKeyIdFrom: (key) => key.split("/")[2],
processPidFrom: (key) => key.split("/").pop().split(".")[0],
Expand All @@ -33,7 +35,14 @@ exports.handler = async (event) => {
Key: key
});

await snsApi.publish({
console.log(`Collected Metadata: ApiKeyId: ${apiKeyId} \
ProcessId: ${pid} \
transcribe-provider: ${provider}
`);

console.log(`Send to ${process.env['TOPIC_ARN']}`);

return snsApi.publish({
Message: 'placeholder',
MessageAttributes: {
bucket: {
Expand All @@ -59,12 +68,4 @@ exports.handler = async (event) => {
},
TopicArn: process.env['TOPIC_ARN']
});

return {
bucket: bucketName,
key: key,
"transcribe-provider": provider,
pid: pid,
"api-key-id": apiKeyId
}
};

0 comments on commit feaf7de

Please sign in to comment.