mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 09:51:13 -05:00
Fix remaining console statements
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { Novu } from "npm:@novu/api@1.6.0";
|
||||
import { startRequest, endRequest } from "../_shared/logger.ts";
|
||||
import { edgeLogger, startRequest, endRequest } from "../_shared/logger.ts";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -42,7 +42,12 @@ serve(async (req) => {
|
||||
? { subscriberId }
|
||||
: { topicKey: topicKey! };
|
||||
|
||||
console.log('Triggering notification:', { workflowId, recipient, requestId: tracking.requestId });
|
||||
edgeLogger.info('Triggering notification', {
|
||||
workflowId,
|
||||
recipient,
|
||||
requestId: tracking.requestId,
|
||||
action: 'trigger_notification'
|
||||
});
|
||||
|
||||
const result = await novu.trigger({
|
||||
to: recipient,
|
||||
@@ -51,7 +56,10 @@ serve(async (req) => {
|
||||
overrides,
|
||||
});
|
||||
|
||||
console.log('Notification triggered successfully:', result.data);
|
||||
edgeLogger.info('Notification triggered successfully', {
|
||||
requestId: tracking.requestId,
|
||||
transactionId: result.data.transactionId
|
||||
});
|
||||
|
||||
endRequest(tracking, 200);
|
||||
|
||||
@@ -72,7 +80,10 @@ serve(async (req) => {
|
||||
);
|
||||
} catch (error: unknown) {
|
||||
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
||||
console.error('Error triggering notification:', errorMessage);
|
||||
edgeLogger.error('Error triggering notification', {
|
||||
requestId: tracking.requestId,
|
||||
error: errorMessage
|
||||
});
|
||||
|
||||
endRequest(tracking, 500, errorMessage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user