Module: ChainReactor

Includes:
Log4r
Defined in:
lib/chain-reactor/version.rb,
lib/chain-reactor/conf.rb,
lib/chain-reactor/client.rb,
lib/chain-reactor/server.rb,
lib/chain-reactor/reactor.rb,
lib/chain-reactor/reaction.rb,
lib/chain-reactor/controller.rb,
lib/chain-reactor/create_log.rb,
lib/chain-reactor/chain_reactor.rb,
lib/chain-reactor/parser_factory.rb,
lib/chain-reactor/chainfile_parser.rb,
lib/chain-reactor/client_connection.rb,
lib/chain-reactor/chain_reactor_client.rb

Overview

The ChainReactor module encapsulates all classes in the gem.

Defined Under Namespace

Modules: Parsers Classes: ChainfileParser, ChainfileParserError, Client, ClientConnection, ClientConnectionError, ClientError, Conf, ConfError, Controller, ParserFactory, Reaction, ReactionError, Reactor, Server

Constant Summary collapse

VERSION =

Current gem version.

"0.2.2"

Class Method Summary collapse

Class Method Details

.create_empty_logger(level) ⇒ Object

Creates a logger object with no outputter.



17
18
19
20
21
# File 'lib/chain-reactor/create_log.rb', line 17

def self.create_empty_logger(level)
  log = Logger.new 'chain-reactor'
  log.level = ChainReactor.const_get(level.upcase)
  log
end

.create_logger(level) ⇒ Object

Creates a logger object that prints to STDOUT.



7
8
9
10
11
12
13
14
# File 'lib/chain-reactor/create_log.rb', line 7

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