aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/tasks/log.rake
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/tasks/log.rake')
-rw-r--r--railties/lib/rails/tasks/log.rake16
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/lib/rails/tasks/log.rake b/railties/lib/rails/tasks/log.rake
index 073f235ec5..c376234fee 100644
--- a/railties/lib/rails/tasks/log.rake
+++ b/railties/lib/rails/tasks/log.rake
@@ -1,8 +1,8 @@
namespace :log do
-
- ##
+
+ ##
# Truncates all/specified log files
- # ENV['LOGS']
+ # ENV['LOGS']
# - defaults to standard environment log files i.e. 'development,test,production'
# - ENV['LOGS']=all truncates all files i.e. log/*.log
# - ENV['LOGS']='test,development' truncates only specified files
@@ -14,21 +14,21 @@ namespace :log do
end
def log_files
- if ENV['LOGS'] == 'all'
+ if ENV["LOGS"] == "all"
FileList["log/*.log"]
- elsif ENV['LOGS']
- log_files_to_truncate(ENV['LOGS'])
+ elsif ENV["LOGS"]
+ log_files_to_truncate(ENV["LOGS"])
else
log_files_to_truncate("development,test,production")
end
end
def log_files_to_truncate(envs)
- envs.split(',')
+ envs.split(",")
.map { |file| "log/#{file.strip}.log" }
.select { |file| File.exist?(file) }
end
-
+
def clear_log_file(file)
f = File.open(file, "w")
f.close