Sha256: b60ae836a12ae1623d66d97a46c4d293e16b715557834d26a54c1057c4ff34d3

Contents?: true

Size: 571 Bytes

Versions: 27

Compression:

Stored size: 571 Bytes

Contents

require 'logger'

module Ridley
  module Logging
    class << self
      # @return [Logger]
      def logger
        @logger ||= begin
          log = Logger.new(STDOUT)
          log.level = Logger::WARN
          log
        end
      end

      # @param [Logger, nil] obj
      #
      # @return [Logger]
      def set_logger(obj)
        @logger = (obj.nil? ? Logger.new('/dev/null') : obj)
      end
      alias_method :logger=, :set_logger
    end

    # @return [Logger]
    def logger
      Ridley::Logging.logger
    end
    alias_method :log, :logger
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ridley-2.0.0 lib/ridley/logging.rb
ridley-1.7.1 lib/ridley/logging.rb
ridley-1.7.0 lib/ridley/logging.rb
ridley-1.6.0 lib/ridley/logging.rb
ridley-1.5.3 lib/ridley/logging.rb
ridley-1.2.6 lib/ridley/logging.rb
ridley-1.5.2 lib/ridley/logging.rb
ridley-1.5.1 lib/ridley/logging.rb
ridley-1.5.0 lib/ridley/logging.rb
ridley-1.2.5 lib/ridley/logging.rb
ridley-1.4.1 lib/ridley/logging.rb
ridley-1.4.0 lib/ridley/logging.rb
ridley-1.3.2 lib/ridley/logging.rb
ridley-1.3.1 lib/ridley/logging.rb
ridley-1.3.0 lib/ridley/logging.rb
ridley-1.0.3 lib/ridley/logging.rb
ridley-1.2.4 lib/ridley/logging.rb
ridley-1.2.3 lib/ridley/logging.rb
ridley-1.2.2 lib/ridley/logging.rb
ridley-1.2.1 lib/ridley/logging.rb