Skip to content

Commit 3e31b3e

Browse files
author
Edward Smith
committed
Don't persist log.
1 parent ba3caf1 commit 3e31b3e

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Branch-SDK/Branch-SDK/Branch.m

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,22 @@ + (void) openLog {
123123
// Initialize the log
124124
@synchronized (self) {
125125
if (bnc_logURL) {
126-
BNCLogSetOutputToURLByteWrap(bnc_logURL, 102400);
126+
#if defined(BNCKeepLogfiles)
127+
BNCLogSetOutputToURLByteWrap(bnc_logURL, 102400);
128+
#else
129+
BNCLogSetOutputFunction(NULL);
130+
#endif
127131
} else {
128132
BNCLogInitialize();
129133
BNCLogSetDisplayLevel(BNCLogLevelAll);
130134
bnc_logURL = BNCURLForBranchDirectory();
131135
bnc_logURL = [[NSURL alloc] initWithString:@"Branch.log" relativeToURL:bnc_logURL];
132-
BNCLogSetOutputToURLByteWrap(bnc_logURL, 102400);
136+
#if defined(BNCKeepLogfiles)
137+
BNCLogSetOutputToURLByteWrap(bnc_logURL, 102400);
138+
#else
139+
BNCLogSetOutputFunction(NULL);
140+
[[NSFileManager defaultManager] removeItemAtURL:bnc_logURL error:nil];
141+
#endif
133142
BNCLogSetDisplayLevel(BNCLogLevelWarning); // Default
134143

135144
// Try loading from the Info.plist

0 commit comments

Comments
 (0)