Sha256: 0ae21e1cf65eca4718a89dc714356daaf3ee40d06fdbd7d56ce8e027418e10d9

Contents?: true

Size: 427 Bytes

Versions: 2

Compression:

Stored size: 427 Bytes

Contents

require 'logger'
require 'singleton'

# Logger
class GCLogger
  include Singleton
  attr_reader :logger

  # Constractor
  def initialize(logdev = STDOUT, shift_age = 0, shift_size = 1048576, params = {})
    init_params = { level: ENV['GC_LOG_LEVEL'] || Logger::Severity::ERROR }
    @logger = Logger.new(logdev, init_params.merge(params).compact)
  end

  # instance of Logger
  def self.logger
    instance.logger
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
growi-client-1.0.1 lib/growi/client/logger.rb
growi-client-1.0.0 lib/growi/client/logger.rb