summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-18 14:58:03 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-18 14:58:03 -0800
commit2f1e05b04b3f1129b6c0ae415c5b0c2c5e62b330 (patch)
tree0b1f407b0cc5d4a71a082cd0a85ed02dc672c19d /lib
parent2a7863a87f685a7bff254cce7e557e9eb143ba7d (diff)
parente8254856a5c9fa532886148cbe2b0f8d87179f01 (diff)
downloadpuppet-2f1e05b04b3f1129b6c0ae415c5b0c2c5e62b330.tar.gz
puppet-2f1e05b04b3f1129b6c0ae415c5b0c2c5e62b330.tar.xz
puppet-2f1e05b04b3f1129b6c0ae415c5b0c2c5e62b330.zip
Merge branch 'maint/next/log_refactoring' into next
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util/log.rb1
-rw-r--r--lib/puppet/util/log/destinations.rb14
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
index 36a765c61..a5aacc265 100644
--- a/lib/puppet/util/log.rb
+++ b/lib/puppet/util/log.rb
@@ -57,6 +57,7 @@ class Puppet::Util::Log
destinations.keys.each { |dest|
close(dest)
}
+ raise Puppet::DevError.new("Log.close_all failed to close #{@destinations.keys.inspect}") if !@destinations.empty?
end
# Flush any log destinations that support such operations.
diff --git a/lib/puppet/util/log/destinations.rb b/lib/puppet/util/log/destinations.rb
index 22b3dedb2..2e2f9a5b7 100644
--- a/lib/puppet/util/log/destinations.rb
+++ b/lib/puppet/util/log/destinations.rb
@@ -203,8 +203,20 @@ Puppet::Util::Log.newdesttype :report do
end
# Log to an array, just for testing.
+module Puppet::Test
+ class LogCollector
+ def initialize(logs)
+ @logs = logs
+ end
+
+ def <<(value)
+ @logs << value
+ end
+ end
+end
+
Puppet::Util::Log.newdesttype :array do
- match "Array"
+ match "Puppet::Test::LogCollector"
def initialize(messages)
@messages = messages