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

Add tests for close_older in case of file rotation and removal #958

Merged
merged 1 commit into from
Feb 29, 2016

Conversation

ruflin
Copy link
Contributor

@ruflin ruflin commented Feb 10, 2016

No description provided.

@@ -283,6 +283,27 @@ def log_contains(self, msg, logfile=None):
except IOError:
return False

def log_contains_count(self, msg, logfile=None):
Copy link
Member

Choose a reason for hiding this comment

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

Since this duplicates most of log_contains(), I think log_contains() could just call this method and return log_contains_count(...) > 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason I didn't implement it this way is that log_contains can exit much faster then count. So in case we have a large log file it is much more efficient. We discussed in the past doing some tests with large log files, which we don't have yet. So this is probably a premature optimization. Will change it.

urso pushed a commit that referenced this pull request Feb 29, 2016
Add tests for close_older in case of file rotation and removal
@urso urso merged commit 505c434 into elastic:master Feb 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants