Sha256: d27da05ec2f8d49ccce00698221e9bd80b89296ec7153e76b1d5e5316d5b654b

Contents?: true

Size: 657 Bytes

Versions: 12

Compression:

Stored size: 657 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 ||= begin
          (defined?(::Rails) && Rails.respond_to?(:logger) && Rails.logger) ||
            DEFAULT_LOGGER
        end
      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

12 entries across 12 versions & 1 rubygems

Version Path
ruby-saml-1.12.4 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.18.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.17.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.12.3 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.16.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.15.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.14.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.13.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.12.2 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.12.1 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.12.0 lib/onelogin/ruby-saml/logging.rb
ruby-saml-1.11.0 lib/onelogin/ruby-saml/logging.rb