Methods

Yell::Adapters

This module provides the interface to attaching adapters to the logger. You should not have to call the corresponding classes directly.

Public Class Methods

new( name, options = {}, &block ) click to toggle source

Returns an instance of the given processor type.

@example A simple file adapter

Yell::Adapters.new( :file )
# File lib/yell/adapters.rb, line 63
def self.new( name, options = {}, &block )
  return name if name.is_a?(Yell::Adapters::Base)

  adapter = case name
  when STDOUT then @adapters[:stdout]
  when STDERR then @adapters[:stderr]
  else @adapters[name.to_sym]
  end

  raise AdapterNotFound.new(name) if adapter.nil?
  adapter.new(options, &block)
end
register( name, klass ) click to toggle source

Register your own adapter here

@example

Yell::Adapters.register( :myadapter, MyAdapter )
# File lib/yell/adapters.rb, line 55
def self.register( name, klass )
  @adapters[name.to_sym] = klass
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.