Class: LogsCfPlugin::Plugin

Inherits:
CF::CLI
  • Object
show all
Includes:
LoginRequirements, MessageWriter
Defined in:
lib/lds-cf-plugin/loggregator/logs.rb

Instance Method Summary collapse

Methods included from MessageWriter

#write

Instance Method Details

#logsObject



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/lds-cf-plugin/loggregator/logs.rb', line 20

def logs
  client.current_organization.name # resolve org name so CC will validate AuthToken

  unless input[:app]
    Mothership::Help.command_help(@@commands[:logs])
    fail "Please provide an application to log."
  end
  port = input[:recent] ? nil : 4443
  client_config = ClientConfig.new(loggregator_host, port, client.token.auth_header, STDOUT, input[:trace], use_ssl)

  TailingLogsClient.new(client_config).logs_for(input[:app], input[:recent])
end