Class: Mixlib::Log::Child
- Inherits:
-
Object
- Object
- Mixlib::Log::Child
- Includes:
- Logging
- Defined in:
- lib/mixlib/log/child.rb
Constant Summary
Constants included from Logging
Logging::LEVELS, Logging::LEVEL_NAMES, Logging::SEV_LABEL, Logging::TRACE
Instance Attribute Summary collapse
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #add(severity, message = nil, progname = nil, data: {}, &block) ⇒ Object
-
#initialize(parent, metadata = {}) ⇒ Child
constructor
A new instance of Child.
- #level ⇒ Object
- #with_child(metadata = {}) ⇒ Object
Methods included from Logging
Constructor Details
#initialize(parent, metadata = {}) ⇒ Child
Returns a new instance of Child.
26 27 28 29 |
# File 'lib/mixlib/log/child.rb', line 26 def initialize(parent, = {}) @parent = parent @metadata = end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
25 26 27 |
# File 'lib/mixlib/log/child.rb', line 25 def @metadata end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
24 25 26 |
# File 'lib/mixlib/log/child.rb', line 24 def parent @parent end |
Instance Method Details
#add(severity, message = nil, progname = nil, data: {}, &block) ⇒ Object
45 46 47 48 |
# File 'lib/mixlib/log/child.rb', line 45 def add(severity, = nil, progname = nil, data: {}, &block) data = .merge(data) if data.is_a?(Hash) parent.send(:pass, severity, , progname, data: data, &block) end |
#level ⇒ Object
31 32 33 |
# File 'lib/mixlib/log/child.rb', line 31 def level parent.level end |