Skip to content

Instantly share code, notes, and snippets.

@m0hadang
Last active March 9, 2024 03:38
Show Gist options
  • Save m0hadang/77edb4ee4dc40f654205ce37f91a8184 to your computer and use it in GitHub Desktop.
Save m0hadang/77edb4ee4dc40f654205ce37f91a8184 to your computer and use it in GitHub Desktop.
get json(sentry native)

sentry native sample(get json)

#include <iostream>
#include "sentry.h"
void TestFunction() {
sentry_value_t event = sentry_value_new_event();
sentry_value_t exc = sentry_value_new_exception("Exception", "Error message.");
sentry_value_set_stacktrace(exc, NULL, 0);
sentry_event_add_exception(event, exc);
auto json = sentry_value_to_json(event);
std::cout << json << std::endl;
}
void main() {
TestFunction();
Sleep(3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment