Module: Logging

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/opencensus/logging.rb', line 19

def self.included(base)
  class << base
    def logger
      Logging.logger
    end
  end
end

.loggerObject



10
11
12
13
14
15
16
17
# File 'lib/opencensus/logging.rb', line 10

def self.logger
  @logger ||= Logger.new(STDOUT)
  @logger.level = ENV['LOG_LEVEL'].to_i || Logger::INFO
  at_exit do
    @logger.close
  end
  @logger
end

Instance Method Details

#default_loggerObject



6
7
8
# File 'lib/opencensus/logging.rb', line 6

def default_logger
  Logging.logger
end