Class: Gitlab::ExternalAuthorization::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/gitlab/external_authorization/logger.rb

Class Method Summary collapse

Methods inherited from Logger

build, cache_key, debug, error, file_name, full_log_path, info, read_latest, warn

Class Method Details

.file_name_noextObject


16
17
18
# File 'lib/gitlab/external_authorization/logger.rb', line 16

def self.file_name_noext
  'external-policy-access-control'
end

.log_access(access, project_path) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'lib/gitlab/external_authorization/logger.rb', line 6

def self.log_access(access, project_path)
  status = access.has_access? ? "GRANTED" : "DENIED"
  message = ["#{status} #{access.user.email} access to '#{access.label}'"]

  message << "(#{project_path})" if project_path.present?
  message << "- #{access.load_type} #{access.loaded_at}" if access.load_type == :cache

  info(message.join(' '))
end