Prevent leaving breadcrumbs when log is below a certain level #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Goal
Currently anything that is below the notify level gets added as a breadcrumb on a log that is notifiable. In one of our apps we use debug logs extensively during development, but don't expect these to be logged on a production environment at all, because they can contain sensitive data.
The intention of the
breadcrumbLevel
is to set a minimum level of a log message for it to be added as a breadcrumb.Design
I have kept it in line with the existing
notifyLevel
property andsetNotifyLevel
method. The default for thebreadcrumbLevel
isDEBUG
. Unless explicitly changed, functionally nothing with change for existing users.Testing
Existing test was modified to set the minimum breadcrumb level to INFO, causing the DEBUG log that was there not to trigger the
leaveBreadcrumb
method.