Sha256: 79fb77aedebb6427e85f4b04ee22fc2baf76fabedd96edfd3e6f6cb2a62c7978

Contents?: true

Size: 524 Bytes

Versions: 3

Compression:

Stored size: 524 Bytes

Contents

module ChainReactor

  require 'log4r'
  include Log4r

  # Creates a logger object that prints to STDOUT.
  def self.create_logger(level)
    log = self.create_empty_logger(level)

    outputter = Outputter.stdout
    outputter.formatter = PatternFormatter.new(:pattern => "%l\t%m")
    log.outputters << outputter
    log
  end

  # Creates a logger object with no outputter.
  def self.create_empty_logger(level)
    log = Logger.new 'chain-reactor'
    log.level = ChainReactor.const_get(level.upcase)
    log
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chain-reactor-0.2.2 lib/chain-reactor/create_log.rb
chain-reactor-0.2.1 lib/chain-reactor/create_log.rb
chain-reactor-0.2.0 lib/chain-reactor/create_log.rb