diff options
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index 6e5d2fe93..77f7a3d64 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -154,6 +154,7 @@ public: { using namespace fmt::literals; + m_UseSentry = ServerOptions.NoSentry == false; m_ServerEntry = ServerEntry; m_DebugOptionForcedCrash = ServerOptions.ShouldCrash; const int ParentPid = ServerOptions.OwnerPid; @@ -343,7 +344,11 @@ public: ZEN_INFO(ZEN_APP_NAME " now running (pid: {})", zen::GetCurrentProcessId()); #if USE_SENTRY - sentry_clear_modulecache(); + ZEN_INFO("sentry crash handler {}", m_UseSentry ? "ENABLED" : "DISABLED"); + if (m_UseSentry) + { + sentry_clear_modulecache(); + } #endif if (m_DebugOptionForcedCrash) @@ -549,6 +554,7 @@ private: #endif bool m_DebugOptionForcedCrash = false; + bool m_UseSentry = false; }; void @@ -803,14 +809,15 @@ int ZenEntryPoint::Run() { #if USE_SENTRY - // Initialize sentry.io client - - sentry_options_t* SentryOptions = sentry_options_new(); - sentry_options_set_dsn(SentryOptions, "https://[email protected]/5919284"); - sentry_options_set_database_path(SentryOptions, PathToUtf8(m_ServerOptions.DataDir / ".sentry-native").c_str()); - sentry_init(SentryOptions); + if (m_ServerOptions.NoSentry == false) + { + sentry_options_t* SentryOptions = sentry_options_new(); + sentry_options_set_dsn(SentryOptions, "https://[email protected]/5919284"); + sentry_options_set_database_path(SentryOptions, PathToUtf8(m_ServerOptions.DataDir / ".sentry-native").c_str()); + sentry_init(SentryOptions); - auto _ = zen::MakeGuard([] { sentry_close(); }); + auto _ = zen::MakeGuard([] { sentry_close(); }); + } #endif auto& ServerOptions = m_ServerOptions; |