Class: Heroku::Command::Logs
Overview
display logs for an app
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#drains ⇒ Object
logs:drains.
-
#index ⇒ Object
logs.
Methods inherited from Base
#api, #app, #heroku, #initialize, namespace
Methods included from Helpers
#action, #ask, #confirm, #confirm_billing, #confirm_command, #create_git_remote, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #error, error_with_failure, error_with_failure=, extended, extended_into, #fail, #format_bytes, #format_date, #format_error, #format_with_bang, #get_terminal_environment, #git, #has_git?, #home_directory, #host_name, #hprint, #hputs, included, included_into, #json_decode, #json_encode, #launchy, #line_formatter, #longest, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #run_command, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #time_ago, #truncate, #with_tty
Constructor Details
This class inherits a constructor from Heroku::Command::Base
Instance Method Details
#drains ⇒ Object
logs:drains
DEPRECATED: use ‘pogo drains`
40 41 42 43 44 |
# File 'lib/heroku/command/logs.rb', line 40 def drains # deprecation notice added 09/30/2011 display("~ `pogo logs:drains` has been deprecated and replaced with `pogo drains`") Heroku::Command::Drains.new.index end |
#index ⇒ Object
logs
display recent log output
-n, –num NUM # the number of lines to display -p, –ps PS # only display logs from the given process -s, –source SOURCE # only display logs from the given source -t, –tail # continually stream logs
Example:
$ pogo logs 2012-01-01T12:00:00+00:00 pogoapp: Config add EXAMPLE by [email protected] 2012-01-01T12:00:01+00:00 pogoapp: Release v1 created by [email protected]
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/heroku/command/logs.rb', line 23 def index validate_arguments! opts = [] opts << "tail=1" if [:tail] opts << "num=#{[:num]}" if [:num] opts << "ps=#{URI.encode([:ps])}" if [:ps] opts << "source=#{URI.encode([:source])}" if [:source] log_displayer = ::Heroku::Helpers::LogDisplayer.new(heroku, app, opts) log_displayer.display_logs end |