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



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

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

Instance Method Details

#logObject



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

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

#statsdObject



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

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