Class: OpenC3::StreamLogPair
- Defined in:
- lib/openc3/logs/stream_log_pair.rb
Overview
Holds a read/write pair of stream logs
Instance Attribute Summary collapse
-
#read_log ⇒ StreamLog
The read log.
-
#write_log ⇒ StreamLog
The write log.
Instance Method Summary collapse
-
#clone ⇒ Object
Clone the stream log pair.
-
#initialize(name, params = []) ⇒ StreamLogPair
constructor
A new instance of StreamLogPair.
-
#name=(name) ⇒ Object
Change the stream log name.
- #shutdown ⇒ Object
-
#start ⇒ Object
Start stream logs.
-
#stop ⇒ Object
Close any open stream log files.
Constructor Details
#initialize(name, params = []) ⇒ StreamLogPair
Returns a new instance of StreamLogPair.
31 32 33 34 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 31 def initialize(name, params = []) @read_log = StreamLog.new(name, :READ, *params) @write_log = StreamLog.new(name, :WRITE, *params) end |
Instance Attribute Details
#read_log ⇒ StreamLog
Returns The read log.
25 26 27 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 25 def read_log @read_log end |
#write_log ⇒ StreamLog
Returns The write log.
27 28 29 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 27 def write_log @write_log end |
Instance Method Details
#clone ⇒ Object
Clone the stream log pair
61 62 63 64 65 66 67 68 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 61 def clone stream_log_pair = super() stream_log_pair.read_log = @read_log.clone stream_log_pair.write_log = @write_log.clone stream_log_pair.read_log.start if @read_log.logging_enabled stream_log_pair.write_log.start if @write_log.logging_enabled stream_log_pair end |
#name=(name) ⇒ Object
Change the stream log name
38 39 40 41 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 38 def name=(name) @read_log.name = name @write_log.name = name end |
#shutdown ⇒ Object
55 56 57 58 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 55 def shutdown @read_log.shutdown @write_log.shutdown end |
#start ⇒ Object
Start stream logs
44 45 46 47 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 44 def start @read_log.start @write_log.start end |
#stop ⇒ Object
Close any open stream log files
50 51 52 53 |
# File 'lib/openc3/logs/stream_log_pair.rb', line 50 def stop @read_log.stop @write_log.stop end |