From 82ad0bfc7f6b2c98e9474bac28b57a984f68e757 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 15 Dec 2024 00:00:32 -0800 Subject: [PATCH] better logging --- src/api.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index d8a3008..7e41fca 100644 --- a/src/api.ts +++ b/src/api.ts @@ -17,16 +17,19 @@ export const main = (port: number) => { jobInsensitive.to.username = "****REDACTED****"; jobInsensitive.to.password = "****REDACTED****"; + const uuid = crypto.randomUUID(); ConsoleLogger.log( - `Received email job: ${JSON.stringify(jobInsensitive)}`, + `[${uuid}] Received email job: ${JSON.stringify(jobInsensitive)}`, )(); const performEmailTest = perform(job)(); return await performEmailTest .then(() => { + ConsoleLogger.log(`[${uuid}] sucess`); return Response.json({ success: true }); }) .catch((error) => { + ConsoleLogger.log(`[${uuid}] failure due to ${error.message}`); return new Response(error.message, { status: 400, });