aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-08-21 18:48:52 +0200
committerStefan Boberg <[email protected]>2021-08-21 18:48:52 +0200
commit276bb86fca388416428613dec981e4e5eb927081 (patch)
treea42f0beb32fd1e61754e007d6ce26809f060a993 /zenserver/zenserver.cpp
parentImproved comment while reviewing code (diff)
downloadzen-276bb86fca388416428613dec981e4e5eb927081.tar.xz
zen-276bb86fca388416428613dec981e4e5eb927081.zip
Improved crash reporting setup and removed old stubs
Also added ability to exercise crash reporting from command line
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 1d1711dfe..d9f72ed12 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -38,7 +38,6 @@
#include "casstore.h"
#include "config.h"
-#include "diag/crashreport.h"
#include "diag/logging.h"
#define SENTRY_BUILD_STATIC 1
@@ -74,6 +73,8 @@ public:
using namespace fmt::literals;
spdlog::info(ZEN_APP_NAME " initializing");
+ m_DebugOptionForcedCrash = ServiceConfig.ShouldCrash;
+
if (ParentPid)
{
m_Process.Initialize(ParentPid);
@@ -195,6 +196,13 @@ public:
spdlog::info(ZEN_APP_NAME " now running");
+ sentry_clear_modulecache();
+
+ if (m_DebugOptionForcedCrash)
+ {
+ __debugbreak();
+ }
+
m_Http.Run(m_TestMode);
spdlog::info(ZEN_APP_NAME " exiting");
@@ -288,6 +296,8 @@ private:
HttpAdminService m_AdminService;
HttpHealthService m_HealthService;
zen::Mesh m_ZenMesh{m_IoContext};
+
+ bool m_DebugOptionForcedCrash = false;
};
int
@@ -295,18 +305,19 @@ main(int argc, char* argv[])
{
mi_version();
+ ZenServerOptions GlobalOptions;
+ ZenServiceConfig ServiceConfig;
+ ParseGlobalCliOptions(argc, argv, GlobalOptions, ServiceConfig);
+ InitializeLogging(GlobalOptions);
+
+ // Initialize sentry.io client
+
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);
- InitializeCrashReporting(GlobalOptions.DataDir / "crashdumps");
- InitializeLogging(GlobalOptions);
-
// Prototype config system, let's see how this pans out
ParseServiceConfig(GlobalOptions.DataDir, /* out */ ServiceConfig);