Parent

Included Modules

Yell::Repository

Public Class Methods

[]( name ) click to toggle source

Get loggers from the repository

@example Get the logger

Yell::Repository[ 'development' ]

@raise [Yell::LoggerNotFound] Raised when repository does not have that key @return [Yell::Logger] The logger instance

# File lib/yell/repository.rb, line 36
def self.[]( name )
  synchronize { instance.__fetch__(name) or raise Yell::LoggerNotFound.new(name) }
end
[]=( name, logger ) click to toggle source

Set loggers in the repository

@example Set a logger

Yell::Repository[ 'development' ] = Yell::Logger.new :stdout

@return [Yell::Logger] The logger instance

# File lib/yell/repository.rb, line 25
def self.[]=( name, logger )
  synchronize { instance.loggers[name] = logger }
end
loggers() click to toggle source

Get the list of all loggers in the repository

@return [Hash] The map of loggers

# File lib/yell/repository.rb, line 43
def self.loggers
  synchronize { instance.loggers }
end
new() click to toggle source
# File lib/yell/repository.rb, line 15
def initialize
  @loggers = {}
end

Public Instance Methods

__fetch__( name ) click to toggle source

@private

Fetch the logger by the given name.

If the logger could not be found and has a superclass, it will attempt to look there. This is important for the Yell::Loggable module.

# File lib/yell/repository.rb, line 59
def __fetch__( name )
  logger = loggers[name] || loggers[name.to_s]

  if logger.nil? && name.respond_to?(:superclass)
    return __fetch__(name.superclass)
  end

  logger
end
loggers() click to toggle source

@private

# File lib/yell/repository.rb, line 48
def loggers
  @loggers
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.