Module: LogStruct::BootBuffer
- Extended by:
- T::Sig
- Defined in:
- lib/log_struct/boot_buffer.rb
Overview
Collects structured logs during very early boot before the logger is ready.
Constant Summary collapse
- @@logs =
T.let([], T::Array[LogStruct::Log::Interfaces::CommonFields])
Class Method Summary collapse
Class Method Details
.add(log) ⇒ Object
12 13 14 |
# File 'lib/log_struct/boot_buffer.rb', line 12 def self.add(log) @@logs << log end |
.clear ⇒ Object
24 25 26 |
# File 'lib/log_struct/boot_buffer.rb', line 24 def self.clear @@logs.clear end |
.flush ⇒ Object
17 18 19 20 21 |
# File 'lib/log_struct/boot_buffer.rb', line 17 def self.flush return if @@logs.empty? @@logs.each { |l| LogStruct.info(l) } @@logs.clear end |