Module: Moro

Defined in:
lib/moro/cli.rb,
lib/moro/log.rb,
lib/moro/daemon.rb,
lib/moro/datadog.rb,
lib/moro/monitor.rb,
lib/moro/process.rb,
lib/moro/version.rb

Defined Under Namespace

Classes: CLI, Daemon, Datadog, Monitor, Process

Constant Summary collapse

VERSION =
'0.0.13'

Class Method Summary collapse

Class Method Details

.initialize_logger(options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/moro/log.rb', line 5

def self.initialize_logger(options={})
  log_levels={"debug"=>Logger::DEBUG,"info"=>Logger::INFO,"warn"=>Logger::WARN,
              "error"=>Logger::ERROR,"fatal"=>Logger::FATAL,"unknown"=>Logger::UNKNOWN}
  level=log_levels[options['log-level']]||Logger::WARN
  @logger = Logger.new STDOUT
  @logger.level = level
end

.loggerObject



13
14
15
16
17
18
# File 'lib/moro/log.rb', line 13

def self.logger
  if @logger.nil?
    initialize_logger
  end
  @logger
end