File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,11 @@ impl Scope {
155155 * self = Default :: default ( ) ;
156156 }
157157
158+ /// Deletes current breadcrumbs from the scope.
159+ pub fn clear_breadcrumbs ( & mut self ) {
160+ self . breadcrumbs . clear ( ) ;
161+ }
162+
158163 /// Sets a level override.
159164 pub fn set_level ( & mut self , level : Option < Level > ) {
160165 self . level = level;
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ fn test_basic_capture_message() {
3030#[ test]
3131fn test_breadcrumbs ( ) {
3232 let events = sentry:: test:: with_captured_events ( || {
33+ sentry:: add_breadcrumb ( || sentry:: Breadcrumb {
34+ ty : "log" . into ( ) ,
35+ message : Some ( "Old breadcrumb to be removed" . into ( ) ) ,
36+ ..Default :: default ( )
37+ } ) ;
38+ sentry:: configure_scope ( |scope| scope. clear_breadcrumbs ( ) ) ;
3339 sentry:: add_breadcrumb ( || sentry:: Breadcrumb {
3440 ty : "log" . into ( ) ,
3541 message : Some ( "First breadcrumb" . into ( ) ) ,
You can’t perform that action at this time.
0 commit comments