Class: Confium::Audit::StderrSink

Inherits:
Sink
  • Object
show all
Defined in:
lib/confium/audit.rb

Overview

Stderr sink — emits each record as a one-line JSON object. Suitable for development and CI; for production prefer FileSink or a structured-logging sink.

Instance Method Summary collapse

Methods inherited from Sink

#call, #close

Constructor Details

#initialize(io: $stderr) ⇒ StderrSink

Returns a new instance of StderrSink.



93
94
95
# File 'lib/confium/audit.rb', line 93

def initialize(io: $stderr)
  @io = io
end

Instance Method Details

#write(record) ⇒ Object



97
98
99
# File 'lib/confium/audit.rb', line 97

def write(record)
  @io.puts(JSON.generate(record))
end