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

rake log:clear task updated #22703

Merged
merged 1 commit into from Jan 9, 2016
Merged

Conversation

pramodshinde
Copy link
Contributor

  • Avoided truncating all files if no ENV['LOGS'] specified
  • Updated task to accept LOGS=all for truncating all files from log/ i.e. log/*log
  • If no LOGS specified will truncates standard environment log files i.e. 'development,test,staging,production'
  • CHANGELOG update added

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @kaspth (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

elsif ENV['LOGS']
log_files_to_truncate(ENV['LOGS'])
else
log_files_to_truncate("development,test,staging,production")
Copy link
Member

Choose a reason for hiding this comment

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

staging is not a default Rails environment. Could you remove it from here? Also from the documentation.

@rafaelfranca
Copy link
Member

I made some comment. After you fixed them make sure you squashed your commits.

@pramodshinde pramodshinde force-pushed the rake-log-clear branch 2 times, most recently from 27c4e6b to 4faab0e Compare January 6, 2016 07:37
@pramodshinde
Copy link
Contributor Author

@rafaelfranca I updated PR as you suggested and squashed commits.

@kaspth
Copy link
Contributor

kaspth commented Jan 6, 2016

Seems like there's failures in Railties, can you inspect?

@pramodshinde
Copy link
Contributor Author

@rafaelfranca @kaspth
I inspected the build failure the issue is in bin_setup_test.rb, as it is testing bin/setup and it uses rake log:clear to clear old files.

Now in this PR I kept default files to truncate are test,development,production if no files specified, but bin_setup_test.rb testing log/my.log truncation.
I updated this test case to test truncation of log/test.log instead of log/my.log as this in not default log.

- Avoided truncating all files if no ENV['LOGS'] specified
- Updated task to accept LOGS=all for truncating all files from log/ i.e. log/*log
- If no LOGS specified will truncates standard environment log files i.e. 'development,test,production'
- CHANGELOG & guide update added
- bin/setup test cases fixed
kaspth added a commit that referenced this pull request Jan 9, 2016
@kaspth kaspth merged commit 9d681fc into rails:master Jan 9, 2016
@kaspth
Copy link
Contributor

kaspth commented Jan 9, 2016

Thanks! 😁

y-yagi added a commit to y-yagi/rails that referenced this pull request Oct 13, 2016
In rails#22703, `log:clear` task has been changed to clear only standard environment
log files.
However, it is often to add a non-standard environment(e.g. "staging").
Therefore, I think than it is better to clear all environments log files by default.
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.

None yet

4 participants