Class: Logging::Appenders::Stderr
- Inherits:
-
IO
- Object
- Logging::Appender
- IO
- Logging::Appenders::Stderr
- Defined in:
- lib/logging/appenders/console.rb
Overview
This class provides an Appender that can write to STDERR.
Constant Summary
Constants included from Buffering
Buffering::DEFAULT_BUFFER_SIZE
Instance Attribute Summary
Attributes included from Buffering
Attributes inherited from Logging::Appender
Instance Method Summary collapse
-
#initialize(*args) ⇒ Stderr
constructor
call-seq: Stderr.new( name = ‘stderr’ ) Stderr.new( :layout => layout ) Stderr.new( name = ‘stderr’, :level => ‘warn’ ).
Methods inherited from IO
Methods included from Buffering
Methods inherited from Logging::Appender
#<<, #append, #close, #closed?, #flush, #inspect
Constructor Details
#initialize(*args) ⇒ Stderr
call-seq:
Stderr.new( name = 'stderr' )
Stderr.new( :layout => layout )
Stderr.new( name = 'stderr', :level => 'warn' )
Creates a new Stderr Appender. The name ‘stderr’ 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
50 51 52 53 54 55 |
# File 'lib/logging/appenders/console.rb', line 50 def initialize( *args ) opts = Hash === args.last ? args.pop : {} name = args.empty? ? 'stderr' : args.shift super(name, STDERR, opts) end |