Module: Interferon::Logging

Included in:
Destinations::Datadog, DynamicLoader, HostSources::Optica, HostSources::OpticaServices, Interferon
Defined in:
lib/interferon/logging.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configure_logger_for(classname) ⇒ Object



19
20
21
22
23
24
# File 'lib/interferon/logging.rb', line 19

def self.configure_logger_for(classname)
  logger = Logger.new(STDERR)
  logger.level = Logger::INFO unless ENV['DEBUG']
  logger.progname = classname
  return logger
end

Instance Method Details

#logObject



15
16
17
# File 'lib/interferon/logging.rb', line 15

def log
  @logger ||= Logging.configure_logger_for(self.class.name)
end

#statsdObject



7
8
9
10
11
12
13
# File 'lib/interferon/logging.rb', line 7

def statsd
  @statsd ||= Statsd.new(
    Statsd::DEFAULT_HOST,
    Statsd::DEFAULT_PORT,
    :namespace => 'alerts_framework'
  )
end