Module: Cosmo::Logger

Extended by:
Forwardable
Defined in:
lib/cosmo/logger.rb

Defined Under Namespace

Modules: Context Classes: BaseFormatter, SimpleFormatter

Class Method Summary collapse

Class Method Details

.instanceObject



62
63
64
65
66
67
# File 'lib/cosmo/logger.rb', line 62

def self.instance
  @instance ||= ::Logger.new($stdout).tap do |logger|
    logger.formatter = SimpleFormatter.new
    logger.level = ::Logger::Severity.coerce(ENV.fetch("COSMO_LOG_LEVEL", "info"))
  end
end

.instance=(logger) ⇒ Object



69
70
71
# File 'lib/cosmo/logger.rb', line 69

def self.instance=(logger)
  @instance = logger
end

.withObject



54
55
56
# File 'lib/cosmo/logger.rb', line 54

def self.with(...)
  Context.with(...)
end

.withoutObject



58
59
60
# File 'lib/cosmo/logger.rb', line 58

def self.without(...)
  Context.without(...)
end