Skip to content

Commit b8169cf

Browse files
authored
Respect sentryOption.debug setting instead of #DEBUG build flag for outputting logs (#2039)
1 parent 9a8b212 commit b8169cf

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
- fix: Respect sentryOption.debug setting instead of #DEBUG build flag for outputting logs #2039
56
- fix: Passing correct mutableOptions to iOS SDK (#2037)
67

78
## 3.2.14-beta.1

ios/RNSentry.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ - (void)setEventEnvironmentTag:(SentryEvent *)event
151151
if (tempContexts != nil) {
152152
[contexts addEntriesFromDictionary:tempContexts];
153153
}
154-
#if DEBUG
155-
NSData *data = [NSJSONSerialization dataWithJSONObject:contexts options:0 error:nil];
156-
NSString *debugContext = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
157-
NSLog(@"Contexts: %@", debugContext);
158-
#endif
154+
if (sentryOptions != nil && sentryOptions.debug) {
155+
NSData *data = [NSJSONSerialization dataWithJSONObject:contexts options:0 error:nil];
156+
NSString *debugContext = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
157+
NSLog(@"Contexts: %@", debugContext);
158+
}
159159
}];
160160
resolve(contexts);
161161
}

0 commit comments

Comments
 (0)