Sha256: a202c69229dd5112d33ebe5253156f57d502f353cf325350d7e35ba8651418fc

Contents?: true

Size: 453 Bytes

Versions: 6

Compression:

Stored size: 453 Bytes

Contents

desc 'Tail application log'
task :tail_logs do
  on roles (:app) do
    tail "#{shared_path}/log/#{fetch(:rails_env)}.log"
  end
end

def with_verbosity(output_verbosity)
  old_verbosity = SSHKit.config.output_verbosity
  begin
    SSHKit.config.output_verbosity = output_verbosity
    yield
  ensure
    SSHKit.config.output_verbosity = old_verbosity
  end
end

def tail(path)
  with_verbosity(Logger::DEBUG) do
    execute "tail -f #{path}"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
caploy-2.0.0 lib/caploy/recipes/taillog.rb
caploy-1.0.4 lib/caploy/recipes/taillog.rb
caploy-1.0.3 lib/caploy/recipes/taillog.rb
caploy-1.0.2 lib/caploy/recipes/taillog.rb
caploy-1.0.1 lib/caploy/recipes/taillog.rb
caploy-1.0.0 lib/caploy/recipes/taillog.rb