Class: RailsSemanticLogging::RSpec::InMemoryAppender
- Inherits:
-
SemanticLogger::Subscriber
- Object
- SemanticLogger::Subscriber
- RailsSemanticLogging::RSpec::InMemoryAppender
- Defined in:
- lib/rails_semantic_logging/rspec/matchers.rb
Overview
In-memory appender that collects log entries for assertion
Instance Attribute Summary collapse
-
#logs ⇒ Object
readonly
Returns the value of attribute logs.
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize ⇒ InMemoryAppender
constructor
A new instance of InMemoryAppender.
- #log(log_entry) ⇒ Object
Constructor Details
#initialize ⇒ InMemoryAppender
Returns a new instance of InMemoryAppender.
9 10 11 12 |
# File 'lib/rails_semantic_logging/rspec/matchers.rb', line 9 def initialize super(level: :trace) @logs = [] end |
Instance Attribute Details
#logs ⇒ Object (readonly)
Returns the value of attribute logs.
7 8 9 |
# File 'lib/rails_semantic_logging/rspec/matchers.rb', line 7 def logs @logs end |
Instance Method Details
#flush ⇒ Object
18 19 20 |
# File 'lib/rails_semantic_logging/rspec/matchers.rb', line 18 def flush # No-op for in-memory end |
#log(log_entry) ⇒ Object
14 15 16 |
# File 'lib/rails_semantic_logging/rspec/matchers.rb', line 14 def log(log_entry) @logs << log_entry end |