summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-28 14:28:05 +0000
committerThom May <thom@chef.io>2018-02-28 14:41:17 +0000
commit6146ee2d6b8e4d8125b66819bb6ab8d6152d859c (patch)
tree385e679b5b4aa0a5602c073deddcb1c2b0b5ac02 /lib
parent38b2ec3bcbbb63516cc8aa8867dfe1d242d2ea22 (diff)
downloadmixlib-log-6146ee2d6b8e4d8125b66819bb6ab8d6152d859c.tar.gz
enable metadata to be got and set
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/mixlib/log.rb3
-rw-r--r--lib/mixlib/log/child.rb1
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/mixlib/log.rb b/lib/mixlib/log.rb
index 7193583..c605148 100644
--- a/lib/mixlib/log.rb
+++ b/lib/mixlib/log.rb
@@ -31,6 +31,7 @@ module Mixlib
def reset!
close!
@logger, @loggers = nil, nil
+ @metadata = {}
end
# An Array of log devices that will be logged to. Defaults to just the default
@@ -92,6 +93,8 @@ module Mixlib
@configured
end
+ attr_accessor :metadata
+
# Sets the level for the Logger object by symbol. Valid arguments are:
#
# :trace
diff --git a/lib/mixlib/log/child.rb b/lib/mixlib/log/child.rb
index 971c956..56376c5 100644
--- a/lib/mixlib/log/child.rb
+++ b/lib/mixlib/log/child.rb
@@ -22,6 +22,7 @@ module Mixlib
include Mixlib::Log::Logging
attr_reader :parent
+ attr_accessor :metadata
def initialize(parent, metadata = {})
@parent = parent
@metadata = metadata