March 2011
1 post
3 tags
Clear your logs automatically in development when...
# config/initializers/clear_logs.rb # This snippet simply clears your logs when they are too large. # Large logs mean looooong search in TextMate. You know it :) # Every time you run rails server or rails console it checks log sizes # and clears the logs for you if necessary. if Rails.env.development? MAX_LOG_SIZE = 2.megabytes logs = File.join(Rails.root, 'log', '*.log') if...
Mar 24th
3 notes