Class: Pvectl::Commands::Logs::Handlers::Journal

Inherits:
Object
  • Object
show all
Includes:
ResourceHandler
Defined in:
lib/pvectl/commands/logs/handlers/journal.rb

Overview

Handler for node systemd journal output.

Fetches journal entries from a node via Repositories::Journal. Not registered in ResourceRegistry — created by Command when –journal flag is set.

Instance Method Summary collapse

Constructor Details

#initialize(repository: nil) ⇒ Journal

Returns a new instance of Journal.



19
20
21
# File 'lib/pvectl/commands/logs/handlers/journal.rb', line 19

def initialize(repository: nil)
  @repository = repository
end

Instance Method Details

#list(node:, limit: 50, since: nil, until_time: nil, **_) ⇒ Object



23
24
25
26
# File 'lib/pvectl/commands/logs/handlers/journal.rb', line 23

def list(node:, limit: 50, since: nil, until_time: nil, **_)
  repository.list(node: node, last_entries: limit, since: since,
                  until_time: until_time)
end

#presenterObject



28
29
30
# File 'lib/pvectl/commands/logs/handlers/journal.rb', line 28

def presenter
  Presenters::JournalEntry.new
end