Class: OneLogin::RubySaml::Logging

Inherits:
Object
  • Object
show all
Defined in:
lib/onelogin/ruby-saml/logging.rb

Constant Summary collapse

DEFAULT_LOGGER =
::Logger.new(STDOUT)

Class Method Summary collapse

Class Method Details

.debug(message) ⇒ Object


17
18
19
20
21
# File 'lib/onelogin/ruby-saml/logging.rb', line 17

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

  logger.debug message
end

.info(message) ⇒ Object


23
24
25
26
27
# File 'lib/onelogin/ruby-saml/logging.rb', line 23

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

  logger.info message
end

.loggerObject


9
10
11
# File 'lib/onelogin/ruby-saml/logging.rb', line 9

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

.logger=(logger) ⇒ Object


13
14
15
# File 'lib/onelogin/ruby-saml/logging.rb', line 13

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