Class: RubySupervisor::ProcessLogsProxy
- Inherits:
-
NamedProxy
- Object
- Proxy
- NamedProxy
- RubySupervisor::ProcessLogsProxy
- Defined in:
- lib/ruby-supervisor/api/process_logs.rb
Instance Attribute Summary
Attributes inherited from NamedProxy
Instance Method Summary collapse
-
#clear ⇒ Object
Clear the logs and reopen them, both stderr and stdout logs will be cleared.
-
#read(offset, length, what = :stdout) ⇒ String
Read chunk of logs for this process.
-
#tail(offset, length, what = :stdout) ⇒ Array
Tail chunk of logs for this process.
Methods inherited from NamedProxy
Methods inherited from Proxy
Constructor Details
This class inherits a constructor from RubySupervisor::NamedProxy
Instance Method Details
#clear ⇒ Object
Clear the logs and reopen them, both stderr and stdout logs will be cleared.
17 18 19 |
# File 'lib/ruby-supervisor/api/process_logs.rb', line 17 def clear request('clearProcessLogs', @name) end |
#read(offset, length, what = :stdout) ⇒ String
Read chunk of logs for this process.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ruby-supervisor/api/process_logs.rb', line 30 def read(offset, length, what = :stdout) case what when :stdout then call = 'readProcessStdoutLog' when :stderr then call = 'readProcessStderrLog' else raise "invalid value for what parameter: #{what}" end request(call, @name, offset, length) end |
#tail(offset, length, what = :stdout) ⇒ Array
Tail chunk of logs for this process.
What is the real difference between read and tail ? I have currently no idea ! documentation is rather… vague.
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ruby-supervisor/api/process_logs.rb', line 54 def tail(offset, length, what = :stdout) case what when :stdout then call = 'tailProcessStdoutLog' when :stderr then call = 'tailProcessStderrLog' else raise "invalid value for what parameter: #{what}" end request(call, @name, offset, length) end |