Method: OpenC3::TriggerModel#log

Defined in:
lib/openc3/models/trigger_model.rb

#log(kind:, message: nil) ⇒ Object

Parameters:

    • the status such as "event" or "error"

  • (defaults to: nil)
    • an optional message to include in the event



322
323
324
325
326
327
328
329
330
331
# File 'lib/openc3/models/trigger_model.rb', line 322

def log(kind:, message: nil)
  notification = {
    'kind' => kind,
    'type' => 'log',
    'time' => Time.now.to_i,
    'name' => @name,
  }
  notification['message'] = message unless message.nil?
  AutonomicTopic.write_notification(notification, scope: @scope)
end