|
9 | 9 | #include <stdio.h> |
10 | 10 | #include <stdlib.h> |
11 | 11 | #include <string.h> |
| 12 | + |
12 | 13 | #ifdef NDEBUG |
13 | 14 | # undef NDEBUG |
14 | 15 | #endif |
| 16 | + |
15 | 17 | #include <assert.h> |
16 | 18 |
|
17 | 19 | #ifdef SENTRY_PLATFORM_WINDOWS |
18 | 20 | # include <synchapi.h> |
19 | 21 | # define sleep_s(SECONDS) Sleep((SECONDS)*1000) |
20 | 22 | #else |
| 23 | + |
21 | 24 | # include <signal.h> |
22 | 25 | # include <unistd.h> |
| 26 | + |
23 | 27 | # define sleep_s(SECONDS) sleep(SECONDS) |
24 | 28 | #endif |
25 | 29 |
|
@@ -260,6 +264,21 @@ main(int argc, char **argv) |
260 | 264 | debug_crumb, "category", sentry_value_new_string("example!")); |
261 | 265 | sentry_value_set_by_key( |
262 | 266 | debug_crumb, "level", sentry_value_new_string("debug")); |
| 267 | + |
| 268 | + // extend the `http` crumb with (optional) data properties as documented |
| 269 | + // here: |
| 270 | + // https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types |
| 271 | + sentry_value_t http_data = sentry_value_new_object(); |
| 272 | + sentry_value_set_by_key(http_data, "url", |
| 273 | + sentry_value_new_string("https://example.com/api/1.0/users")); |
| 274 | + sentry_value_set_by_key( |
| 275 | + http_data, "method", sentry_value_new_string("GET")); |
| 276 | + sentry_value_set_by_key( |
| 277 | + http_data, "status_code", sentry_value_new_int32(200)); |
| 278 | + sentry_value_set_by_key( |
| 279 | + http_data, "reason", sentry_value_new_string("OK")); |
| 280 | + sentry_value_set_by_key(debug_crumb, "data", http_data); |
| 281 | + |
263 | 282 | sentry_add_breadcrumb(debug_crumb); |
264 | 283 |
|
265 | 284 | sentry_value_t nl_crumb |
|
0 commit comments