From feb888db2d557066ebe9eb3bb1d7e3b052ae1221 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Mon, 9 Jun 2025 12:22:27 +0200 Subject: `--sentry-dsn` option for zen command line and zenserver to control Sentry reporting endpoint (#427) moved sentry database path to temporary directory for zen commandline --- src/zencore/sentryintegration.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/zencore/sentryintegration.cpp') diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp index d08fb7f1d..520d5162e 100644 --- a/src/zencore/sentryintegration.cpp +++ b/src/zencore/sentryintegration.cpp @@ -31,6 +31,10 @@ ZEN_THIRD_PARTY_INCLUDES_END namespace sentry { +namespace { + static const std::string DefaultDsn("https://8ba3441bebc941c1ae24b8cd2fd25d55@o10593.ingest.sentry.io/5919284"); +} + struct SentryAssertImpl : zen::AssertImpl { virtual void ZEN_FORCENOINLINE ZEN_DEBUG_SECTION @@ -194,6 +198,7 @@ SentryIntegration::~SentryIntegration() void SentryIntegration::Initialize(std::string SentryDatabasePath, std::string SentryAttachmentsPath, + std::string SentryDsn, bool AllowPII, const std::string& CommandLine) { @@ -204,7 +209,7 @@ SentryIntegration::Initialize(std::string SentryDatabasePath, SentryDatabasePath = SentryDatabasePath.substr(4); } sentry_options_t* SentryOptions = sentry_options_new(); - sentry_options_set_dsn(SentryOptions, "https://8ba3441bebc941c1ae24b8cd2fd25d55@o10593.ingest.sentry.io/5919284"); + sentry_options_set_dsn(SentryOptions, SentryDsn.empty() ? sentry::DefaultDsn.c_str() : SentryDsn.c_str()); sentry_options_set_database_path(SentryOptions, SentryDatabasePath.c_str()); sentry_options_set_logger(SentryOptions, SentryLogFunction, this); if (!SentryAttachmentsPath.empty()) -- cgit v1.2.3