Skip to content

Add support for report filtering#10

Merged
AlexVanderbist merged 1 commit intospatie:mainfrom
Jellyfrog:patch-2
Aug 8, 2022
Merged

Add support for report filtering#10
AlexVanderbist merged 1 commit intospatie:mainfrom
Jellyfrog:patch-2

Conversation

@Jellyfrog
Copy link
Contributor

@Jellyfrog Jellyfrog commented Aug 4, 2022

Adds the ability to prevent reports from being sent.

The motivation behind it that we need a way to dynamically allow/disallow reports from being sent, for example based on if git tree is clean, which can be compute heavy and cannot be done during boot.

Compared to filterExceptionsCallable it can also prevent logs and errors from being sent, and that's why it's in sendReportToApi() instead of shouldSendReport()

Usage is something like this:

Flare::filterReportsUsing(function(Report $report) {
  return false;
});

Adds the ability to prevent reports from being sent.

The motivation behind it that we need a way to dynamically allow/disallow reports from being sent, for example based on if git tree is clean

Usage is something like this:

Flare::filterReportsUsing(function(Report $report) {
  return false;
});
@AlexVanderbist
Copy link
Member

Thanks, another nice addition! I've also documented this method in the Flare docs.

@AlexVanderbist AlexVanderbist merged commit b1b9743 into spatie:main Aug 8, 2022
@Jellyfrog Jellyfrog deleted the patch-2 branch September 29, 2022 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants