Class: Locd::CLI::Command::RotateLogs
- Inherits:
-
Job
show all
- Defined in:
- lib/locd/cli/command/rotate_logs.rb,
lib/locd/cli/command/rotate_logs/add.rb
Overview
Class Method Summary
collapse
-
.agent_class ⇒ Object
Helpers ============================================================================.
Instance Method Summary
collapse
Methods inherited from Job
parse_every_option
Methods inherited from Agent
agent_type, #ls, #open, #rm, #status, #tail, #truncate_logs, #update
Class Method Details
.agent_class ⇒ Object
45
46
47
|
# File 'lib/locd/cli/command/rotate_logs.rb', line 45
def self.agent_class
Locd::Agent::RotateLogs
end
|
Instance Method Details
#add ⇒ Object
26
27
28
29
30
31
32
33
34
|
# File 'lib/locd/cli/command/rotate_logs/add.rb', line 26
def add
agent = agent_class.add **option_kwds( groups: [ :write, :add ] )
logger.info "#{ agent_class.name } `#{ agent.label }` created."
agent.reload if options[:load]
respond agent
end
|
#plist ⇒ Object
99
100
101
102
103
104
105
|
# File 'lib/locd/cli/command/rotate_logs.rb', line 99
def plist
if options[:json] || options[:yaml]
respond agent.plist
else
respond agent.path.read
end
end
|
#restart ⇒ Object
135
136
137
|
# File 'lib/locd/cli/command/rotate_logs.rb', line 135
def restart
agent.restart **option_kwds( :write, groups: :stop )
end
|
#start ⇒ Object
113
114
115
|
# File 'lib/locd/cli/command/rotate_logs.rb', line 113
def start
agent.start **option_kwds( :write )
end
|
#stop ⇒ Object
124
125
126
|
# File 'lib/locd/cli/command/rotate_logs.rb', line 124
def stop
agent.stop **option_kwds( :unload, groups: :stop )
end
|