Class: Fluent::BufferedStdoutOutput
- Inherits:
-
ObjectBufferedOutput
- Object
- ObjectBufferedOutput
- Fluent::BufferedStdoutOutput
- Defined in:
- lib/fluent/plugin/out_buffered_stdout.rb
Constant Summary collapse
- OUTPUT_PROCS =
{ :json => Proc.new {|record| Yajl.dump(record) }, :hash => Proc.new {|record| record.to_s }, }
Instance Method Summary collapse
Instance Method Details
#configure(conf) ⇒ Object
26 27 28 29 |
# File 'lib/fluent/plugin/out_buffered_stdout.rb', line 26 def configure(conf) super @output_proc = OUTPUT_PROCS[@output_type] end |
#write_objects(tag, es) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/fluent/plugin/out_buffered_stdout.rb', line 31 def write_objects(tag, es) now = Time.now es.each {|time,record| log.write "#{now.localtime} #{Time.at(time).localtime} #{tag}: #{@output_proc.call(record)}\n" } log.flush end |