@@ -66,7 +66,7 @@ public class SentryOptions {
6666 * Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging
6767 * information if something goes wrong. Default is disabled.
6868 */
69- private boolean debug ;
69+ private @ Nullable Boolean debug ;
7070
7171 /** Turns NDK on or off. Default is enabled. */
7272 private boolean enableNdk = true ;
@@ -270,6 +270,7 @@ public class SentryOptions {
270270 options .setEnableUncaughtExceptionHandler (
271271 propertiesProvider .getBooleanProperty ("uncaught.handler.enabled" ));
272272 options .setTracesSampleRate (propertiesProvider .getDoubleProperty ("traces-sample-rate" ));
273+ options .setDebug (propertiesProvider .getBooleanProperty ("debug" ));
273274 final Map <String , String > tags = propertiesProvider .getMap ("tags" );
274275 for (final Map .Entry <String , String > tag : tags .entrySet ()) {
275276 options .setTag (tag .getKey (), tag .getValue ());
@@ -353,18 +354,27 @@ public void setDsn(@Nullable String dsn) {
353354 * @return true if ON or false otherwise
354355 */
355356 public boolean isDebug () {
356- return debug ;
357+ return Boolean . TRUE . equals ( debug ) ;
357358 }
358359
359360 /**
360361 * Sets the debug mode to ON or OFF Default is OFF
361362 *
362363 * @param debug true if ON or false otherwise
363364 */
364- public void setDebug (boolean debug ) {
365+ public void setDebug (final @ Nullable Boolean debug ) {
365366 this .debug = debug ;
366367 }
367368
369+ /**
370+ * Check if debug mode is ON, OFF or not set.
371+ *
372+ * @return true if ON or false otherwise
373+ */
374+ private @ Nullable Boolean getDebug () {
375+ return debug ;
376+ }
377+
368378 /**
369379 * Returns the Logger interface
370380 *
@@ -1305,6 +1315,9 @@ void merge(final @NotNull SentryOptions options) {
13051315 if (options .getTracesSampleRate () != null ) {
13061316 setTracesSampleRate (options .getTracesSampleRate ());
13071317 }
1318+ if (options .getDebug () != null ) {
1319+ setDebug (options .getDebug ());
1320+ }
13081321 final Map <String , String > tags = new HashMap <>(options .getTags ());
13091322 for (final Map .Entry <String , String > tag : tags .entrySet ()) {
13101323 this .tags .put (tag .getKey (), tag .getValue ());
0 commit comments