Module: Signalwire::Logger

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loggerLogger

A global logger object

Returns:

  • (Logger)

    a Logger instance



10
11
12
13
14
15
16
# File 'lib/signalwire/logger.rb', line 10

def logger
  @logger ||= begin
    logger = ::Logger.new(STDERR, progname: 'SignalWire', level: ::Logger::DEBUG)
    logger.level = ENV.fetch('SIGNALWIRE_LOG_LEVEL', ::Logger::INFO)
    logger
  end
end

Instance Method Details

#level=(level) ⇒ Object



23
24
25
# File 'lib/signalwire/logger.rb', line 23

def level=(level)
  Signalwire::Logger.logger.level = level
end

#loggerObject



19
20
21
# File 'lib/signalwire/logger.rb', line 19

def logger
  Signalwire::Logger.logger
end