Class: Logging::Appenders::Stdout
- Inherits:
-
IO
- Object
- Logging::Appender
- IO
- Logging::Appenders::Stdout
- Defined in:
- lib/logging/appenders/console.rb
Overview
This class provides an Appender that can write to STDOUT.
Constant Summary
Constants included from Buffering
Buffering::DEFAULT_BUFFER_SIZE
Instance Attribute Summary
Attributes inherited from IO
Attributes included from Buffering
#auto_flushing, #buffer, #flush_period
Attributes inherited from Logging::Appender
Instance Method Summary collapse
-
#initialize(*args) ⇒ Stdout
constructor
call-seq: Stdout.new( name = ‘stdout’ ) Stdout.new( :layout => layout ) Stdout.new( name = ‘stdout’, :level => ‘info’ ).
Methods inherited from IO
Methods included from Buffering
#close, #flush, #immediate_at=, #reopen
Methods inherited from Logging::Appender
#<<, #append, #close, #closed?, #flush, #inspect, #reopen
Constructor Details
#initialize(*args) ⇒ Stdout
call-seq:
Stdout.new( name = 'stdout' )
Stdout.new( :layout => layout )
Stdout.new( name = 'stdout', :level => 'info' )
Creates a new Stdout Appender. The name ‘stdout’ will be used unless another is given. Optionally, a layout can be given for the appender to use (otherwise a basic appender will be created) and a log level can be specified.
Options:
:layout => the layout to use when formatting log events
:level => the level at which to log
23 24 25 26 27 28 |
# File 'lib/logging/appenders/console.rb', line 23 def initialize( *args ) opts = Hash === args.last ? args.pop : {} name = args.empty? ? 'stdout' : args.shift super(name, STDOUT, opts) end |