diff options
| author | Dan Engelbrecht <[email protected]> | 2025-06-09 12:22:27 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-06-09 12:22:27 +0200 |
| commit | feb888db2d557066ebe9eb3bb1d7e3b052ae1221 (patch) | |
| tree | 38002b17f35699ba61ac3d08994c3f2fa5aec8b7 /src/zen/zen.cpp | |
| parent | use unique tmp name for auth token file (#426) (diff) | |
| download | archived-zen-feb888db2d557066ebe9eb3bb1d7e3b052ae1221.tar.xz archived-zen-feb888db2d557066ebe9eb3bb1d7e3b052ae1221.zip | |
`--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
Diffstat (limited to 'src/zen/zen.cpp')
| -rw-r--r-- | src/zen/zen.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/zen/zen.cpp b/src/zen/zen.cpp index 119215d40..f0644a4f5 100644 --- a/src/zen/zen.cpp +++ b/src/zen/zen.cpp @@ -872,12 +872,18 @@ main(int argc, char** argv) #endif // ZEN_WITH_TRACE #if ZEN_USE_SENTRY - bool NoSentry = false; - bool SentryAllowPII = false; - Options.add_options()("no-sentry", "Disable Sentry crash handler", cxxopts::value<bool>(NoSentry)->default_value("false")); - Options.add_options()("sentry-allow-personal-info", - "Allow personally identifiable information in sentry crash reports", - cxxopts::value<bool>(SentryAllowPII)->default_value("false")); + bool NoSentry = false; + bool SentryAllowPII = false; + std::string SentryDsn; + Options + .add_option("sentry", "", "no-sentry", "Disable Sentry crash handler", cxxopts::value<bool>(NoSentry)->default_value("false"), ""); + Options.add_option("sentry", + "", + "sentry-allow-personal-info", + "Allow personally identifiable information in sentry crash reports", + cxxopts::value<bool>(SentryAllowPII)->default_value("false"), + ""); + Options.add_option("sentry", "", "sentry-dsn", "Sentry DSN to send events to", cxxopts::value<std::string>(SentryDsn), ""); #endif Options.parse_positional({"command"}); @@ -926,7 +932,7 @@ main(int argc, char** argv) if (NoSentry == false) { - std::string SentryDatabasePath = (GetRunningExecutablePath().parent_path() / ".sentry-native").string(); + std::string SentryDatabasePath = (std::filesystem::temp_directory_path() / ".zen-sentry-native").string(); ExtendableStringBuilder<512> SB; for (int i = 0; i < argc; ++i) @@ -939,7 +945,7 @@ main(int argc, char** argv) SB.Append(argv[i]); } - Sentry.Initialize(SentryDatabasePath, {}, SentryAllowPII, SB.ToString()); + Sentry.Initialize(SentryDatabasePath, {}, SentryDsn, SentryAllowPII, SB.ToString()); SentryIntegration::ClearCaches(); } |