2022-01-17 15:24:07 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# This class provides logging functionalities for SSO authentication
|
|
|
|
class SsoLogger
|
2023-03-22 17:30:37 +01:00
|
|
|
def initialize
|
|
|
|
@logger = ActiveSupport::TaggedLogging.new(Logger.new($stdout))
|
|
|
|
@log_status = ENV.fetch('SSO_DEBUG', false)
|
2022-01-17 15:24:07 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def debug(message)
|
|
|
|
return unless @log_status
|
|
|
|
|
|
|
|
@logger.tagged('SSO') { @logger.debug(message) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def info(message)
|
|
|
|
@logger.tagged('SSO') { @logger.info(message) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def warn(message)
|
|
|
|
@logger.tagged('SSO') { @logger.warn(message) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def error(message)
|
|
|
|
@logger.tagged('SSO') { @logger.error(message) }
|
|
|
|
end
|
|
|
|
end
|