Method: Chalk::Log::Logger#initialize

Defined in:
lib/chalk-log/logger.rb

#initialize(name) ⇒ Logger

Create a new logger, and auto-initialize everything.



31
32
33
34
35
36
37
38
39
40
# File 'lib/chalk-log/logger.rb', line 31

def initialize(name)
  # It's generally a bad pattern to auto-init, but we want
  # Chalk::Log to be usable anytime during the boot process, which
  # requires being a little bit less explicit than we usually like.
  Chalk::Log.init
  @backend = ::Logging::Logger.new(name)
  if level = configatron.chalk.log.default_level
    @backend.level = level
  end
end