Sha256: 2669566c6e6ebdae5cfc2a5fd700b28773968a6595fe84ad497a92807c93dc81

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

require 'logger'

require 'quandl/logger/version'

require "active_support"
require "active_support/inflector"
require "active_support/core_ext/hash"
require "active_support/core_ext/object"

module Quandl
  class Logger
    class << self
  
      delegate :<<, :add, :close, :datetime_format, :datetime_format=, 
        :debug, :debug?, :error, :error?, :fatal, :fatal?, :info, :info?, 
        :log, :unknown, :warn, :warn?, 
        # to logger, allowing nil
        to: :logger, allow_nil: true
        
      def logger
        @@logger if defined?(@@logger)
      end
      
      def use(log_file)
        log_file = ::Logger.new(log_file) if log_file.is_a?(String)
        @@logger = log_file
      end
  
    end
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quandl_logger-0.0.2 lib/quandl/logger.rb