From 2aa4b16fb40a280744a9a5e74c55d82283b159cb Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 27 Jan 2025 15:52:33 +0100 Subject: [PATCH] feat: enable debug-option by default in debug-build. (#1128) --- CHANGELOG.md | 4 ++++ src/sentry_options.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38b658202..7312935dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +**Features**: + +- Enable debug-option by default when running in a debug-build. ([#1128](https://github.com/getsentry/sentry-native/pull/1128)) + **Fixes**: - Allow older toolchains with assemblers that don't support PAC-stripping instructions on `aarch64` to compile `crashpad`. ([#1125](https://github.com/getsentry/sentry-native/pull/1125), [crashpad#118](https://github.com/getsentry/crashpad/pull/118)) diff --git a/src/sentry_options.c b/src/sentry_options.c index 60db87a28..55fc8bc0b 100644 --- a/src/sentry_options.c +++ b/src/sentry_options.c @@ -22,6 +22,11 @@ sentry_options_new(void) sentry_options_set_dsn(opts, getenv("SENTRY_DSN")); const char *debug = getenv("SENTRY_DEBUG"); opts->debug = debug && sentry__string_eq(debug, "1"); +#if !defined(NDEBUG) + if (!opts->debug && (!debug || !sentry__string_eq(debug, "0"))) { + opts->debug = 1; + } +#endif sentry_logger_t logger = { sentry__logger_defaultlogger, NULL, SENTRY_LEVEL_DEBUG }; opts->logger = logger;