Sha256: 176740cd084f5df3cc7e78ade6cda6602de618fc102821e353c824ad7e3ac598

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

# Personalizes the authorization logging by adding Auth | in front of each line.
# It also outputs the time stamp and the severity of the log message.
class AuthorizationLogger < ActiveSupport::BufferedLogger
  # Prefix for each message
  AUTHORIZATION_SYSTEM_LOG_MSG_PREFIX = 'Auth |'
  
  # overriding of the formatting message
  def format_message(severity, timestamp, progname, msg)
      "#{AUTHORIZATION_SYSTEM_LOG_MSG_PREFIX} #{timestamp.to_formatted_s(:db)} #{severity} #{msg}\n" 
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
role_based_authorization-0.3.1 lib/role_based_authorization/authorization_logger.rb
role_based_authorization-0.3.0 lib/role_based_authorization/authorization_logger.rb