Module: CapistranoMisc::Misc::Log

Defined in:
lib/capistrano-misc/misc/log.rb

Class Method Summary collapse

Class Method Details

.load_into(configuration) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/capistrano-misc/misc/log.rb', line 3

def self.load_into(configuration)
  configuration.load do
    namespace :misc do
      task :log, roles: :app do
        file = ENV['file'] || "*.log"
        run "tail -f #{current_path}/log/#{file}" do |channel, stream, data|
          trap("INT") { puts "Interupted!"; exit 0; }
          puts data
          puts
          break if stream == :err
        end
      end
    end
  end
end