diff options
| author | Dan Engelbrecht <[email protected]> | 2025-06-12 09:30:54 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-06-12 09:30:54 +0200 |
| commit | fdad92dddba8047930c4e7496a7f412d760c312e (patch) | |
| tree | 7f54ad72d7f6de0a778e643669c733dd6e359b77 /src/zencore/sentryintegration.cpp | |
| parent | 5.6.12 (diff) | |
| download | zen-fdad92dddba8047930c4e7496a7f412d760c312e.tar.xz zen-fdad92dddba8047930c4e7496a7f412d760c312e.zip | |
sentry config (#430)
- Feature: Added `--sentry-environment` to `zen` and `zenserver`
- Feature: Added `--sentry-debug` to `zen` and `zenserver`
- Feature: Added environment variable parsing for the following options:
- `UE_ZEN_SENTRY_ENABLED`: `--no-sentry` (inverted)
- `UE_ZEN_SENTRY_DEBUG`: `--sentry-debug`
- `UE_ZEN_SENTRY_ALLOWPERSONALINFO`: `--sentry-allow-personal-info`
- `UE_ZEN_SENTRY_DSN`: `--sentry-dsn`
- `UE_ZEN_SENTRY_ENVIRONMENT`: `--sentry-environment`
Diffstat (limited to 'src/zencore/sentryintegration.cpp')
| -rw-r--r-- | src/zencore/sentryintegration.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp index 520d5162e..118c4158a 100644 --- a/src/zencore/sentryintegration.cpp +++ b/src/zencore/sentryintegration.cpp @@ -196,22 +196,23 @@ SentryIntegration::~SentryIntegration() } void -SentryIntegration::Initialize(std::string SentryDatabasePath, - std::string SentryAttachmentsPath, - std::string SentryDsn, - bool AllowPII, - const std::string& CommandLine) +SentryIntegration::Initialize(const Config& Conf, const std::string& CommandLine) { - m_AllowPII = AllowPII; + m_AllowPII = Conf.AllowPII; + std::string SentryDatabasePath = Conf.DatabasePath; if (SentryDatabasePath.starts_with("\\\\?\\")) { SentryDatabasePath = SentryDatabasePath.substr(4); } sentry_options_t* SentryOptions = sentry_options_new(); - sentry_options_set_dsn(SentryOptions, SentryDsn.empty() ? sentry::DefaultDsn.c_str() : SentryDsn.c_str()); + + sentry_options_set_dsn(SentryOptions, Conf.Dsn.empty() ? sentry::DefaultDsn.c_str() : Conf.Dsn.c_str()); sentry_options_set_database_path(SentryOptions, SentryDatabasePath.c_str()); sentry_options_set_logger(SentryOptions, SentryLogFunction, this); + sentry_options_set_environment(SentryOptions, Conf.Environment.empty() ? "production" : Conf.Environment.c_str()); + + std::string SentryAttachmentsPath = Conf.AttachmentsPath; if (!SentryAttachmentsPath.empty()) { if (SentryAttachmentsPath.starts_with("\\\\?\\")) @@ -222,7 +223,10 @@ SentryIntegration::Initialize(std::string SentryDatabasePath, } sentry_options_set_release(SentryOptions, ZEN_CFG_VERSION); - // sentry_options_set_debug(SentryOptions, 1); + if (Conf.Debug) + { + sentry_options_set_debug(SentryOptions, 1); + } m_SentryErrorCode = sentry_init(SentryOptions); |