Class: Appfront::Command::Logs

Inherits:
Base
  • Object
show all
Defined in:
lib/appfront/command/logs.rb

Class Method Summary collapse

Class Method Details

.tail(opts) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/appfront/command/logs.rb', line 2

def self.tail(opts)
  find_deploy! opts

  max_id = nil

  begin
    res = api.get "/flow/#{@deploy}/logs?max_id=#{max_id}"
    max_id, events = res['max_id'], res['events']
    events.each {|e| puts e }
    sleep 2
  end while opts[:follow]

rescue Exception
  system("clear")
end