Skip to content

Commit

Permalink
chore: improve log readability
Browse files Browse the repository at this point in the history
  • Loading branch information
rileydcampbell committed Nov 9, 2023
1 parent 6a4f732 commit c0790cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/handlers/order-notification/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export class OrderNotificationHandler extends DynamoStreamLambdaHandler<Containe
filler: newOrder.filler,
})

log.info({ order: newOrder, registeredEndpoints }, 'Sending order to registered webhooks.')

const requests: Promise<AxiosResponse>[] = registeredEndpoints.map((endpoint) =>
axios.post(
endpoint.url,
Expand Down Expand Up @@ -58,6 +60,7 @@ export class OrderNotificationHandler extends DynamoStreamLambdaHandler<Containe
results.forEach((result, index) => {
metrics.putMetric(`OrderNotificationAttempt-chain-${newOrder.chainId}`, 1)
if (result.status == 'fulfilled' && result?.value?.status >= 200 && result?.value?.status <= 202) {
delete result.value.request
log.info(
{ result: result.value },
`Success: New order record sent to registered webhook ${registeredEndpoints[index].url}.`
Expand Down

0 comments on commit c0790cc

Please sign in to comment.