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-1.2.0 lib/ridley/logging.rb
ridley-1.1.1 lib/ridley/logging.rb
ridley-1.1.0 lib/ridley/logging.rb
ridley-1.0.2 lib/ridley/logging.rb
ridley-1.0.1 lib/ridley/logging.rb
ridley-1.0.0 lib/ridley/logging.rb
ridley-1.0.0.rc3 lib/ridley/logging.rb