Class: Plushie::Event::DiagnosticMessage

Inherits:
Data
  • Object
show all
Defined in:
lib/plushie/event/diagnostic.rb

Overview

A structured diagnostic delivered through the renderer's diagnostic wire channel.

Wire shape: {type: "diagnostic", session, level, diagnostic: {kind, ...}}. The +diagnostic+ field is one of the typed variants in Diagnostic.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session:, level:, diagnostic:) ⇒ DiagnosticMessage

Returns a new instance of DiagnosticMessage.



216
217
218
# File 'lib/plushie/event/diagnostic.rb', line 216

def initialize(session:, level:, diagnostic:)
  super
end

Instance Attribute Details

#diagnosticObject (readonly)

Returns the value of attribute diagnostic

Returns:

  • (Object)

    the current value of diagnostic



215
216
217
# File 'lib/plushie/event/diagnostic.rb', line 215

def diagnostic
  @diagnostic
end

#diagnostic [Object] typed diagnostic variant([Object]) ⇒ Object (readonly)

A structured diagnostic delivered through the renderer's diagnostic wire channel.

Wire shape: {type: "diagnostic", session, level, diagnostic: {kind, ...}}. The +diagnostic+ field is one of the typed variants in Plushie::Event::Diagnostic.



215
216
217
218
219
# File 'lib/plushie/event/diagnostic.rb', line 215

DiagnosticMessage = Data.define(:session, :level, :diagnostic) do
  def initialize(session:, level:, diagnostic:)
    super
  end
end

#levelObject (readonly)

Returns the value of attribute level

Returns:

  • (Object)

    the current value of level



215
216
217
# File 'lib/plushie/event/diagnostic.rb', line 215

def level
  @level
end

#level [Symbol] :info, :warn, or :error([Symbol], : warn) ⇒ Object (readonly)

A structured diagnostic delivered through the renderer's diagnostic wire channel.

Wire shape: {type: "diagnostic", session, level, diagnostic: {kind, ...}}. The +diagnostic+ field is one of the typed variants in Plushie::Event::Diagnostic.



215
216
217
218
219
# File 'lib/plushie/event/diagnostic.rb', line 215

DiagnosticMessage = Data.define(:session, :level, :diagnostic) do
  def initialize(session:, level:, diagnostic:)
    super
  end
end

#sessionObject (readonly)

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



215
216
217
# File 'lib/plushie/event/diagnostic.rb', line 215

def session
  @session
end

#session [String] session the diagnostic is attributable to.([String]) ⇒ Object (readonly)

An empty string for process-scoped diagnostics (font load failures, renderer startup / panic, writer-dead, anything that affects the whole renderer rather than a single session). Non-empty for session-scoped diagnostics (widget panics, view errors, tree validation warnings, anything produced inside a session's update / apply pipeline).



215
216
217
218
219
# File 'lib/plushie/event/diagnostic.rb', line 215

DiagnosticMessage = Data.define(:session, :level, :diagnostic) do
  def initialize(session:, level:, diagnostic:)
    super
  end
end