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



20
21
22
23
24
# File 'lib/onelogin/ruby-saml/logging.rb', line 20

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

  logger.debug message
end

.info(message) ⇒ Object



26
27
28
29
30
# File 'lib/onelogin/ruby-saml/logging.rb', line 26

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

  logger.info message
end

.loggerObject



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

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

.logger=(logger) ⇒ Object



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

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