Skip to content

Commit 528a538

Browse files
committed
Removing Scoped Attachments
1 parent 3492ab7 commit 528a538

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • platform-includes/enriching-events/add-attachment

platform-includes/enriching-events/add-attachment/native.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,13 @@ sentry_capture_event_with_scope(event, scope);
2525
```
2626

2727
<Alert>☝ When using the `crashpad` backend on macOS, the list of attachments that will be added at the time of a hard crash will be frozen at the time of `sentry_init`, and later modifications will not be reflected.</Alert>
28+
29+
### Removing Scoped Attachments
30+
31+
To remove attachments from the global scope, you can use the `sentry_attachment_t` handle returned by `sentry_attach_file`. After removing the attachment, the file will no longer be uploaded with any future events or crashes and the handle becomes invalid.
32+
33+
```c
34+
sentry_attachment_t *attachment = sentry_attach_file("/var/temp.log");
35+
/* ... */
36+
sentry_remove_attachment(attachment);
37+
```

0 commit comments

Comments
 (0)