Class: Harbor::CLI::Logs
- Inherits:
-
Object
- Object
- Harbor::CLI::Logs
- Defined in:
- lib/harbor/cli/logs.rb
Instance Method Summary collapse
-
#initialize(options, config) ⇒ Logs
constructor
A new instance of Logs.
- #logs(project_name) ⇒ Object
Constructor Details
Instance Method Details
#logs(project_name) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/harbor/cli/logs.rb', line 12 def logs(project_name) if @options["follow"] # Live tail: exec's kamal directly so stdout streams in real time. # Kernel can't deliver a stream through its synchronous call API. # The adapter log fetch that the kernel exposes is for bounded # retrieval (last N lines). Follow mode is a different surface. stream_logs(project_name) else output = @tools.call( "harbor_get_logs", { "project" => project_name, "role" => @options["role"], "lines" => @options["lines"], "grep" => @options["grep"], "destination" => @options["destination"] }, actor: cli_actor, origin: :cli ) $stdout.puts output end rescue Harbor::Error => e $stderr.puts "#{e.class.name.split('::').last}: #{e.}" exit 1 end |