Sha256: 692815299b33cb6ed88750e5eadde5d80b1cfb14b77a138551fdc0fe6599e50e
Contents?: true
Size: 915 Bytes
Versions: 5
Compression:
Stored size: 915 Bytes
Contents
module Percheron module Actions class Logs include Base def initialize(unit, follow: false) @unit = unit @follow = follow end def execute! $logger.debug "Showing logs on '#{unit.display_name}' unit" display_logs! end private attr_reader :unit, :follow alias_method :follow?, :follow def options { stdout: true, stderr: true, timestamps: true, tail: 100 } end def display_logs! if follow? opts = options.merge(follow: true) unit.container.streaming_logs(opts) do |stream, chunk| puts "#{stream}: #{chunk}" end else puts unit.container.logs(options) end rescue Interrupt nil end end end end
Version data entries
5 entries across 5 versions & 1 rubygems