Method: OpenC3::StreamLog#initialize

Defined in:
lib/openc3/logs/stream_log.rb

#initialize(log_name, log_type, cycle_time = 600, cycle_size = 50_000_000, cycle_hour = nil, cycle_minute = nil) ⇒ StreamLog



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/openc3/logs/stream_log.rb', line 44

def initialize(
  log_name,
  log_type,
  cycle_time = 600, # 10 minutes, matches time in target_model
  cycle_size = 50_000_000, # 50MB, matches size in target_model
  cycle_hour = nil,
  cycle_minute = nil
)
  raise "log_type must be :READ or :WRITE" unless LOG_TYPES.include? log_type

  super(
    "#{ENV['OPENC3_SCOPE']}/stream_logs/",
    true, # Start with logging enabled
    cycle_time,
    cycle_size,
    cycle_hour,
    cycle_minute
  )

  @log_type = log_type
  self.name = log_name
end