Sha256: a4e37bb289b0ccaf81655b603bf8f3d8a088a4828a8a31ac94ec69fda7388c5b

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 KB

Contents

# $Id: console.rb 26 2007-01-31 23:19:40Z tim_pease $

require 'logging/appenders/io'

module Logging
module Appenders

  #
  # This class provides an Appender that can write to STDOUT.
  #
  class Stdout< ::Logging::Appenders::IO

    #
    # call-seq:
    #    Stdout.new
    #    Stdout.new( :layout => layout )
    #
    # Creates a new Stdout Appender. The name 'stdout' will always be used for
    # this appender.
    #
    def initialize( name = nil, opts = {} )
      name ||= 'stdout'
      STDOUT.sync = true
      super(name, STDOUT, opts)
    end
  end  # class Stdout

  #
  # This class provides an Appender that can write to STDERR.
  #
  class Stderr< ::Logging::Appenders::IO

    #
    # call-seq:
    #    Stderr.new
    #    Stderr.new( :layout => layout )
    #
    # Creates a new Stderr Appender. The name 'stderr' will always be used for
    # this appender.
    #
    def initialize( name = nil, opts = {} )
      name ||= 'stderr'
      STDERR.sync = true
      super(name, STDERR, opts)
    end
  end  # class Stderr

end  # module Appenders
end  # module Logging

# EOF

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logging-0.3.0 lib/logging/appenders/console.rb
logging-0.3.1 lib/logging/appenders/console.rb