Skip to content

Commit

Permalink
Don't flush ddlog when flushing stdout or stderr stream redirector
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Jan 4, 2025
1 parent a73022d commit 664d3a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions Monal/Classes/MLStreamRedirect.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ -(void) flushWithWaitBlock:(monal_void_block_t) waitBlock
DDLogVerbose(@"Waiting for flush of fd %d to complete...", fileno(self->_stream));
waitBlock();
DDLogVerbose(@"Flush on fd %d completed...", fileno(self->_stream));
[DDLog flushLog];
}

-(void) flushAndCloseWithWaitBlock:(monal_void_block_t) waitBlock
Expand All @@ -163,7 +162,6 @@ -(void) flushAndCloseWithWaitBlock:(monal_void_block_t) waitBlock

//wait for this eof signal and flush our DDLog afterwards to make sure everything reached the log sinks
waitBlock();
[DDLog flushLog];
}

-(void) signalFlushCompleted
Expand Down
4 changes: 2 additions & 2 deletions Monal/Classes/MonalAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,7 @@ -(void) applicationWillTerminate:(UIApplication *)application
DDLogInfo(@"|~~| T E R M I N A T E D |~~|");
[DDLog flushLog];
[HelperTools flushLogsWithTimeout:0.025];
[DDLog flushLog];
}
}

Expand Down Expand Up @@ -1421,7 +1422,6 @@ -(void) checkIfBackgroundTaskIsStillNeeded
if(background)
{
DDLogInfo(@"### All accounts idle, disconnecting and stopping all background tasks ###");
[DDLog flushLog];
DDLogVerbose(@"Setting _shutdownPending to YES...");
_shutdownPending = YES;
[HelperTools scheduleBackgroundTask:NO]; //request bg fetch execution in BGFETCH_DEFAULT_INTERVAL seconds
Expand Down Expand Up @@ -1464,7 +1464,7 @@ -(void) checkIfBackgroundTaskIsStillNeeded
}
if(!stopped)
{
DDLogDebug(@"no background tasks running, nothing to stop");
DDLogError(@"no background tasks running, nothing to stop");
[DDLog flushLog];
}
else
Expand Down

0 comments on commit 664d3a0

Please sign in to comment.