Sha256: c595d12d1ef4c2aba436e8bfb65c966dc06fb5edf02f9a1da759afd9e1116db2

Contents?: true

Size: 498 Bytes

Versions: 8

Compression:

Stored size: 498 Bytes

Contents

require 'logger'

module AppPerfAgent
  class Logger
    def self.initialize_logger(log_target = STDOUT)
      oldlogger = defined?(@logger) ? @logger : nil
      @logger = ::Logger.new(log_target)
      @logger.level = ::Logger::INFO
      @logger
    end

    def self.logger
      defined?(@logger) ? @logger : initialize_logger
    end

    def self.logger=(log)
      @logger = (log ? log : ::Logger.new(File::NULL))
    end

    def logger
      AppPerfAgent::Logger.logger
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
app_perf_agent-0.0.9 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.8 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.7 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.6 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.5 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.4 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.3 lib/app_perf_agent/logger.rb
app_perf_agent-0.0.2 lib/app_perf_agent/logger.rb