Sha256: ecf5bf84e73a0d770d88174572429a5e627a961e2d5180155d905f3e9d0feb12

Contents?: true

Size: 616 Bytes

Versions: 6

Compression:

Stored size: 616 Bytes

Contents

require 'logger'

# Simplistic log class when we're running in Rails
module OneLogin
  module RubySaml
    class Logging
      DEFAULT_LOGGER = ::Logger.new(STDOUT)

      def self.logger
        @logger || (defined?(::Rails) && Rails.respond_to?(:logger) && Rails.logger) || DEFAULT_LOGGER
      end

      def self.logger=(logger)
        @logger = logger
      end

      def self.debug(message)
        return if !!ENV["ruby-saml/testing"]

        logger.debug message
      end

      def self.info(message)
        return if !!ENV["ruby-saml/testing"]

        logger.info message
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-saml-1.8.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.7.2 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.7.1 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.6.2 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.7.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.6.1 lib/onelogin/ruby-saml/logging.rb