Class: Karafka::Instrumentation::Logger

Inherits:
Logger
  • Object
show all
Includes:
Singleton
Defined in:
lib/karafka/instrumentation/logger.rb

Overview

Note:

It uses ::Logger features - providing basic logging

Default logger for Event Delegator

Constant Summary collapse

ENV_MAP =

Map containing information about log level for given environment

{
  'production' => ::Logger::ERROR,
  'test' => ::Logger::ERROR,
  'development' => ::Logger::INFO,
  'debug' => ::Logger::DEBUG,
  'default' => ::Logger::INFO
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(*_args) ⇒ Logger

Creates a new instance of logger ensuring that it has a place to write to



20
21
22
23
24
# File 'lib/karafka/instrumentation/logger.rb', line 20

def initialize(*_args)
  ensure_dir_exists
  super(target)
  self.level = ENV_MAP[Karafka.env] || ENV_MAP['default']
end