chore: replace standard logging with signale

This commit is contained in:
Dries Augustyns
2025-12-10 14:21:42 +01:00
parent 3225c5005b
commit 1430f31e2d
18 changed files with 85 additions and 68 deletions
+5 -4
View File
@@ -1,5 +1,6 @@
import {type Contact, Prisma, type Segment} from '@plunk/db';
import type {FilterCondition, FilterGroup, SegmentFilter} from '@plunk/types';
import signale from 'signale';
import {prisma} from '../database/prisma.js';
import {HttpException} from '../exceptions/index.js';
@@ -276,7 +277,7 @@ export class SegmentService {
data: {memberCount},
});
} catch (error) {
console.error(`Failed to update count for segment ${segment.id}:`, error);
signale.error(`Failed to update count for segment ${segment.id}:`, error);
}
}),
);
@@ -383,7 +384,7 @@ export class SegmentService {
segmentName: segment.name,
});
} catch (error) {
console.error(`[SEGMENT] Failed to track segment entry event for contact ${contactId}:`, error);
signale.error(`[SEGMENT] Failed to track segment entry event for contact ${contactId}:`, error);
}
}
}
@@ -414,7 +415,7 @@ export class SegmentService {
segmentName: segment.name,
});
} catch (error) {
console.error(`[SEGMENT] Failed to track segment exit event for contact ${contactId}:`, error);
signale.error(`[SEGMENT] Failed to track segment exit event for contact ${contactId}:`, error);
}
}
}
@@ -425,7 +426,7 @@ export class SegmentService {
data: {memberCount: matchingContactIds.size},
});
console.log(
signale.info(
`[SEGMENT] Computed membership for segment ${segmentId}: added ${toAdd.length}, removed ${toRemove.length}, total ${matchingContactIds.size}`,
);