Sha256: 0b021e8c8d22c0b7156b0183fe5107f3b803b1407ffdf1abedb7e8a5570caab7
Contents?: true
Size: 703 Bytes
Versions: 34
Compression:
Stored size: 703 Bytes
Contents
require_relative '../helpers/log_helper' module Kontena::Cli::Stacks class LogsCommand < Kontena::Command include Kontena::Cli::Common include Kontena::Cli::GridOptions include Kontena::Cli::Helpers::LogHelper banner "Shows logs from services in a stack" parameter "NAME", "Stack name" requires_current_master requires_current_master_token def execute show_logs("stacks/#{current_grid}/#{name}/container_logs") do |log| show_log(log) end end def show_log(log) color = color_for_container(log['name']) prefix = "#{log['created_at']} [#{log['name']}]:".colorize(color) puts "#{prefix} #{log['data']}" end end end
Version data entries
34 entries across 34 versions & 1 rubygems