Class: DLogger::Output::Stdout
- Defined in:
- lib/dlogger/outputs/stdout.rb
Overview
Outputs data to stdout.
Instance Method Summary collapse
- #dispatch(msg, metadata) ⇒ Object
-
#initialize(dump_metadata = true) ⇒ Stdout
constructor
A new instance of Stdout.
Constructor Details
#initialize(dump_metadata = true) ⇒ Stdout
Returns a new instance of Stdout.
15 16 17 18 19 |
# File 'lib/dlogger/outputs/stdout.rb', line 15 def initialize( = true) # without this you may not be able to tail the logs $stdout.sync = true @dump_metadata = end |
Instance Method Details
#dispatch(msg, metadata) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/dlogger/outputs/stdout.rb', line 24 def dispatch(msg, ) if @dump_metadata Kernel.puts("#{msg} : #{.inspect}") else Kernel.puts(msg) end end |