Skip to content

Commit f7c9b2d

Browse files
committed
Add logging
1 parent 2a35c09 commit f7c9b2d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/plugins/default/DuplicateCheckerPlugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class DuplicateCheckerPlugin implements IEventPlugin {
4040

4141
let error = context.event.data['@error'];
4242
let hashCode = getHashCode(error);
43+
4344
if (!hashCode) {
4445
return;
4546
}
@@ -51,16 +52,19 @@ export class DuplicateCheckerPlugin implements IEventPlugin {
5152
if (merged) {
5253
merged.incrementCount(count);
5354
merged.updateDate(context.event.date);
55+
context.log.info("Ignoring duplicate event with hash: " + hashCode);
5456
context.cancelled = true;
5557
return;
5658
}
5759

5860
if (this._processedHashcodes.some(h => h.hash === hashCode && h.timestamp >= (now - this._interval))) {
61+
context.log.info("Adding event with hash: " + hashCode);
5962
this._mergedEvents.push(new MergedEvent(hashCode, context, count));
6063
context.cancelled = true;
6164
return;
6265
}
6366

67+
context.log.info("Enqueueing event with hash: " + hashCode + "to cache.");
6468
this._processedHashcodes.push({ hash: hashCode, timestamp: now });
6569

6670
// Only keep the last 50 recent errors.

0 commit comments

Comments
 (0)