Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check and log some errors. #250

Conversation

ewanmellor
Copy link
Contributor

Log the streamError whenever we fail to write during compression,
and log any failures when removing the original file or cleaning up
the temporary file after compression failed.

@@ -329,6 +330,7 @@ - (void)backgroundThread_CompressLogFile:(DDLogFileInfo *)logFile
if (writeLength < 0)
{
error = YES;
streamError = [outputStream streamError];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could just remove error now and just check !streamError in the enclosing while condition.

@rivera-ernesto
Copy link
Member

Nice!

@ewanmellor
Copy link
Contributor Author

Yes, you're right that we don't need both error and streamError. Let me re-submit this one -- I have another PR coming which will be impacted too.

@rivera-ernesto
Copy link
Member

Thank you for all the pull requests. I'll try to leave the more sensitive ones however for @dvor .

Log the streamError whenever we fail to write during compression,
and log any failures when removing the original file or cleaning up
the temporary file after compression failed.
@ewanmellor
Copy link
Contributor Author

Re-submitted. This version just uses a single NSError* error variable instead of the BOOL error and NSError* streamError. It also re-uses the NSError* in the cleanup instead of having a separate one.

@rivera-ernesto
Copy link
Member

Thank you!

rivera-ernesto pushed a commit that referenced this pull request Apr 1, 2014
@rivera-ernesto rivera-ernesto merged commit a74aa0b into CocoaLumberjack:master Apr 1, 2014
@ewanmellor ewanmellor deleted the CompressingLogFileManager-log-stream-error branch April 1, 2014 07:43
@bpoplauschi bpoplauschi added this to the 1.9.0 milestone May 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants