Module: Mixlib::Log::Logging

Includes:
Logger::Severity
Included in:
Mixlib::Log, Child, Logger
Defined in:
lib/mixlib/log/logging.rb

Constant Summary collapse

TRACE =
-1
SEV_LABEL =
%w{TRACE DEBUG INFO WARN ERROR FATAL ANY}.each(&:freeze).freeze
LEVELS =
{ trace: TRACE, debug: DEBUG, info: INFO, warn: WARN, error: ERROR, fatal: FATAL }.freeze
LEVEL_NAMES =
LEVELS.invert.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#metadataObject

Returns the value of attribute metadata.



35
36
37
# File 'lib/mixlib/log/logging.rb', line 35

def 
  @metadata
end

Instance Method Details

#pass(severity, args, progname = nil, data: {}, &block) ⇒ Object



37
38
39
40
# File 'lib/mixlib/log/logging.rb', line 37

def pass(severity, args, progname = nil, data: {}, &block)
  args, progname, data = yield if block_given?
  add(severity, args, progname, data: data)
end

#to_label(sev) ⇒ Object



28
29
30
# File 'lib/mixlib/log/logging.rb', line 28

def to_label(sev)
  SEV_LABEL[sev + 1] || -"ANY"
end