module Logging::Appenders

a replacement EmailOutputter. This is essentially the default EmailOutputter from Log4r but with the following changes:

1) if there is data to send in an email, then do not send anything
2) connect to the smtp server at the last minute, do not connect at startup and then send later on.
3) Fix the To: field so that it looks alright.

Public Instance Methods

Appenders[name] click to toggle source

Returns the appender instance stored in the appender hash under the key name, or nil if no appender has been created using that name.

# File lib/logging/appenders.rb, line 80
def []( name ) @appenders[name] end
Appenders[name] = appender click to toggle source

Stores the given appender instance in the appender hash under the key name.

# File lib/logging/appenders.rb, line 88
def []=( name, value ) @appenders[name] = value end
each {|appender| block} click to toggle source

Yield each appender to the block.

# File lib/logging/appenders.rb, line 103
def each( &block )
  @appenders.values.each(&block)
  return nil
end
email( *args ) click to toggle source

Accessor / Factory for the Email appender.

# File lib/logging/appenders.rb, line 7
def email( *args )
  return ::Logging::Appenders::Email if args.empty?
  ::Logging::Appenders::Email.new(*args)
end
file( *args ) click to toggle source

Accessor / Factory for the File appender.

# File lib/logging/appenders.rb, line 14
def file( *args )
  return ::Logging::Appenders::File if args.empty?
  ::Logging::Appenders::File.new(*args)
end
growl( *args ) click to toggle source

Accessor / Factory for the Growl appender.

# File lib/logging/appenders.rb, line 21
def growl( *args )
  return ::Logging::Appenders::Growl if args.empty?
  ::Logging::Appenders::Growl.new(*args)
end
io( *args ) click to toggle source

Accessor / Factory for the IO appender.

# File lib/logging/appenders.rb, line 28
def io( *args )
  return ::Logging::Appenders::IO if args.empty?
  ::Logging::Appenders::IO.new(*args)
end
remove( name ) click to toggle source

Removes the appender instance stored in the appender hash under the key name.

# File lib/logging/appenders.rb, line 96
def remove( name ) @appenders.delete(name) end
rolling_file( *args ) click to toggle source

Accessor / Factory for the RollingFile appender.

# File lib/logging/appenders.rb, line 35
def rolling_file( *args )
  return ::Logging::Appenders::RollingFile if args.empty?
  ::Logging::Appenders::RollingFile.new(*args)
end
stderr( *args ) click to toggle source

Accessor / Factory for the Stderr appender.

# File lib/logging/appenders.rb, line 42
def stderr( *args )
  if args.empty?
    return self['stderr'] || ::Logging::Appenders::Stderr.new
  end
  ::Logging::Appenders::Stderr.new(*args)
end
stdout( *args ) click to toggle source

Accessor / Factory for the Stdout appender.

# File lib/logging/appenders.rb, line 51
def stdout( *args )
  if args.empty?
    return self['stdout'] || ::Logging::Appenders::Stdout.new
  end
  ::Logging::Appenders::Stdout.new(*args)
end
string_io( *args ) click to toggle source

Accessor / Factory for the StringIo appender.

# File lib/logging/appenders.rb, line 60
def string_io( *args )
  return ::Logging::Appenders::StringIo if args.empty?
  ::Logging::Appenders::StringIo.new(*args)
end
syslog( *args ) click to toggle source

Accessor / Factory for the Syslog appender.

# File lib/logging/appenders.rb, line 68
def syslog( *args )
  return ::Logging::Appenders::Syslog if args.empty?
  ::Logging::Appenders::Syslog.new(*args)
end