-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eventprocessors): Add name field to EventProcessor (#4932)
- Loading branch information
Showing
9 changed files
with
67 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
import { getCurrentHub } from '@sentry/hub'; | ||
import { configureScope } from '@sentry/minimal'; | ||
import { Event, Integration } from '@sentry/types'; | ||
import { Event, EventProcessor, Integration } from '@sentry/types'; | ||
|
||
export class TestIntegration implements Integration { | ||
public static id: string = 'TestIntegration'; | ||
|
||
public name: string = 'TestIntegration'; | ||
|
||
public setupOnce(): void { | ||
configureScope(scope => { | ||
scope.addEventProcessor((event: Event) => { | ||
if (!getCurrentHub().getIntegration(TestIntegration)) { | ||
return event; | ||
} | ||
const eventProcessor: EventProcessor = (event: Event) => { | ||
if (!getCurrentHub().getIntegration(TestIntegration)) { | ||
return event; | ||
} | ||
|
||
return null; | ||
}; | ||
|
||
return null; | ||
}); | ||
eventProcessor.id = this.name; | ||
|
||
configureScope(scope => { | ||
scope.addEventProcessor(eventProcessor); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters