Skip to content

Commit 0618b68

Browse files
rationalise logging
1 parent 6ba834a commit 0618b68

2 files changed

Lines changed: 1 addition & 27 deletions

File tree

lambdas/supplier-allocator/src/handler/allocate-handler.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ function resolveSupplierForVariant(
3232
variantId: string,
3333
deps: Deps,
3434
): SupplierSpec {
35-
deps.logger.info({
36-
description: "Resolving supplier for letter variant",
37-
variantId,
38-
});
3935
const supplier = deps.env.VARIANT_MAP[variantId];
4036
if (!supplier) {
4137
deps.logger.error({
@@ -135,13 +131,9 @@ async function getSupplierFromConfig(
135131
},
136132
volumeGroupId: volumeGroup.id,
137133
};
138-
deps.logger.info({
139-
description: "Resolved supplier details for letter event",
140-
supplierDetails,
141-
});
142134
return supplierDetails;
143135
} catch (error) {
144-
deps.logger.error({
136+
deps.logger.info({
145137
description: "Error fetching supplier from config",
146138
err: error,
147139
variantId: letterEvent.data.letterVariantId,
@@ -196,12 +188,6 @@ function incrementAllocation(
196188
allocation: number,
197189
deps: Deps,
198190
) {
199-
deps.logger.info({
200-
description: "Incrementing allocation for volume group and supplier",
201-
volumeGroupId,
202-
supplierId,
203-
allocation,
204-
});
205191
const groupAllocations = map.get(volumeGroupId) ?? {};
206192
groupAllocations[supplierId] =
207193
(groupAllocations[supplierId] ?? 0) + allocation;
@@ -217,10 +203,6 @@ async function saveAllocations(
217203
deps: Deps,
218204
volumeGroupAllocations: VolumeGroupAllocation,
219205
) {
220-
deps.logger.info({
221-
description: "Saving supplier allocations for volume groups",
222-
volumeGroupAllocations,
223-
});
224206
for (const [volumeGroupId, allocations] of volumeGroupAllocations) {
225207
for (const [supplierId, allocation] of Object.entries(allocations)) {
226208
await updateSupplierAllocation(

lambdas/supplier-allocator/src/services/supplier-config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ export async function filterPacksForLetter(
229229
) {
230230
filteredPackIds.push(packSpecId);
231231
} else {
232-
deps.logger.info({
233-
description: "Evaluating pack specification constraints for letter",
234-
letterVariantId: letterEvent.data.letterVariantId,
235-
packSpecId,
236-
pageCount: letterEvent.data.pageCount,
237-
constraintValue: packSpec.constraints.sheets.value,
238-
constraintOperator: packSpec.constraints.sheets.operator,
239-
});
240232
const isValid = evaluateContraint(
241233
letterEvent.data.pageCount,
242234
packSpec.constraints.sheets.value,

0 commit comments

Comments
 (0)