Sha256: e36ca3069a90d801be6fc1ff4d3c7dad0dd12ad3903f5e67be418c21fec93d8e

Contents?: true

Size: 586 Bytes

Versions: 17

Compression:

Stored size: 586 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.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

17 entries across 17 versions & 3 rubygems

Version Path
ruby-saml-1.6.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.5.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.4.3 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.4.2 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.4.1 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.4.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.3.1 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.3.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.2.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.1.2 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.1.1 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.1.0 lib/onelogin/ruby-saml/logging.rb
r-saml-1.0.1 lib/onelogin/ruby-saml/logging.rb
kl-ruby-saml-0.0.3 lib/onelogin/ruby-saml/logging.rb
kl-ruby-saml-0.0.2 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.0.0 lib/onelogin/ruby-saml/logging.rb
kl-ruby-saml-0.0.1 lib/onelogin/ruby-saml/logging.rb