Class: Gitlab::MultiDestinationLogger

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

Direct Known Subclasses

AppLogger

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.debug(message) ⇒ Object


9
10
11
# File 'lib/gitlab/multi_destination_logger.rb', line 9

def self.debug(message)
  loggers.each { |logger| logger.build.debug(message) }
end

.error(message) ⇒ Object


13
14
15
# File 'lib/gitlab/multi_destination_logger.rb', line 13

def self.error(message)
  loggers.each { |logger| logger.build.error(message) }
end

.file_nameObject


29
30
31
# File 'lib/gitlab/multi_destination_logger.rb', line 29

def self.file_name
  primary_logger.file_name
end

.file_name_noextObject


37
38
39
# File 'lib/gitlab/multi_destination_logger.rb', line 37

def self.file_name_noext
  primary_logger.file_name_noext
end

.full_log_pathObject


33
34
35
# File 'lib/gitlab/multi_destination_logger.rb', line 33

def self.full_log_path
  primary_logger.full_log_path
end

.info(message) ⇒ Object


21
22
23
# File 'lib/gitlab/multi_destination_logger.rb', line 21

def self.info(message)
  loggers.each { |logger| logger.build.info(message) }
end

.loggersObject

Raises:

  • (NotImplementedError)

41
42
43
# File 'lib/gitlab/multi_destination_logger.rb', line 41

def self.loggers
  raise NotImplementedError
end

.primary_loggerObject

Raises:

  • (NotImplementedError)

45
46
47
# File 'lib/gitlab/multi_destination_logger.rb', line 45

def self.primary_logger
  raise NotImplementedError
end

.read_latestObject


25
26
27
# File 'lib/gitlab/multi_destination_logger.rb', line 25

def self.read_latest
  primary_logger.read_latest
end

.warn(message) ⇒ Object


17
18
19
# File 'lib/gitlab/multi_destination_logger.rb', line 17

def self.warn(message)
  loggers.each { |logger| logger.build.warn(message) }
end

Instance Method Details

#closeObject


5
6
7
# File 'lib/gitlab/multi_destination_logger.rb', line 5

def close
  loggers.each(&:close)
end