aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 08b3d6c05..e6cb95a7b 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -151,6 +151,7 @@ class ZenServer : public IHttpStatusProvider
public:
void Initialize(const ZenServerOptions& ServerOptions, ZenServerState::ZenServerEntry* ServerEntry)
{
+ m_UseSentry = ServerOptions.NoSentry == false;
m_ServerEntry = ServerEntry;
m_DebugOptionForcedCrash = ServerOptions.ShouldCrash;
const int ParentPid = ServerOptions.OwnerPid;
@@ -340,7 +341,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)
@@ -547,6 +552,7 @@ private:
#endif
bool m_DebugOptionForcedCrash = false;
+ bool m_UseSentry = false;
};
void
@@ -801,14 +807,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;