mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
28 lines
610 B
Ruby
28 lines
610 B
Ruby
# frozen_string_literal: true
|
|
|
|
# This class provides logging functionalities for SSO authentication
|
|
class SsoLogger
|
|
def initialize
|
|
@logger = ActiveSupport::TaggedLogging.new(Logger.new($stdout))
|
|
@log_status = ENV.fetch('SSO_DEBUG', false)
|
|
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
|