diff options
| author | Stefan Boberg <[email protected]> | 2021-08-20 22:14:27 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-08-20 22:14:27 +0200 |
| commit | 08c281f8d9a8d122fc008f16abe3c7b1d4092444 (patch) | |
| tree | 3cda9ee6370ffd268400fe825a5a19e8758a1e8d | |
| parent | Added logic to fix project store tests (we use absolute file paths in the tes... (diff) | |
| download | zen-08c281f8d9a8d122fc008f16abe3c7b1d4092444.tar.xz zen-08c281f8d9a8d122fc008f16abe3c7b1d4092444.zip | |
Added initial sentry.io support for crash tracking etc
| -rw-r--r-- | vcpkg.json | 3 | ||||
| -rw-r--r-- | zenserver/zenserver.cpp | 14 |
2 files changed, 16 insertions, 1 deletions
diff --git a/vcpkg.json b/vcpkg.json index 793abeab0..982c74b0f 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -22,6 +22,7 @@ "name": "rocksdb", "features": [ "lz4", "zstd" ] }, - "sol2" + "sol2", + "sentry-native" ] } diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index b26efc6ec..1d1711dfe 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -5,6 +5,7 @@ #include <zencore/httpserver.h> #include <zencore/iobuffer.h> #include <zencore/refcount.h> +#include <zencore/scopeguard.h> #include <zencore/string.h> #include <zencore/thread.h> #include <zencore/timer.h> @@ -40,6 +41,13 @@ #include "diag/crashreport.h" #include "diag/logging.h" +#define SENTRY_BUILD_STATIC 1 +#include <sentry.h> +#pragma comment(lib, "sentry.lib") +#pragma comment(lib, "dbghelp.lib") +#pragma comment(lib, "winhttp.lib") +#pragma comment(lib, "version.lib") + ////////////////////////////////////////////////////////////////////////// // Services // @@ -287,6 +295,12 @@ main(int argc, char* argv[]) { mi_version(); + sentry_options_t* SentryOptions = sentry_options_new(); + sentry_options_set_dsn(SentryOptions, "https://[email protected]/5919284"); + sentry_init(SentryOptions); + + auto _ = zen::MakeGuard([&] { sentry_close(); }); + ZenServerOptions GlobalOptions; ZenServiceConfig ServiceConfig; ParseGlobalCliOptions(argc, argv, GlobalOptions, ServiceConfig); |