Class: CFTools::Tunnel::WatchLogs
- Defined in:
- lib/tools-cf-plugin/tunnel/watch-logs.rb
Constant Summary collapse
- LOGS =
{ "cloud_controller" => ["cloud_controller_ng/cloud_controller_ng.log"], "dea_next" => ["dea_next/dea_next.log"], "health_manager" => ["health_manager_next/health_manager_next.log"], "router" => ["gorouter/gorouter.log"] }
Constants inherited from Base
Instance Method Summary collapse
-
#color? ⇒ Boolean
colorize if told to; don’t check if output is tty.
- #watch_logs ⇒ Object
Methods inherited from Base
#authenticate_with_director, #connected_director, #director, #login_to_director, #precondition, #tunnel_to
Instance Method Details
#color? ⇒ Boolean
colorize if told to; don’t check if output is tty
18 19 20 |
# File 'lib/tools-cf-plugin/tunnel/watch-logs.rb', line 18 def color? input[:color] end |
#watch_logs ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/tools-cf-plugin/tunnel/watch-logs.rb', line 27 def watch_logs director_host = input[:director] components = input[:components] gateway = input[:gateway] director = connected_director(director_host, gateway) deployment = with_progress("Getting deployment info") do current_deployment(director) end locations = with_progress("Finding logs for #{c(deployment["name"], :name)}") do locs = stream_locations(director, deployment["name"], components) if locs.empty? fail "No locations found." else locs end end stream = stream_for(director, deployment["name"], gateway) stream.stream(locations) do |entry| line pretty_print_entry(entry) end end |