From a4562bfba94d18da54ad9560245d0669cc151c76 Mon Sep 17 00:00:00 2001 From: luke Date: Wed, 16 Nov 2005 17:12:11 +0000 Subject: Lots of refactoring, and added the capture_stderr method git-svn-id: https://reductivelabs.com/svn/puppet/trunk@742 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/log.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/puppet/log.rb') diff --git a/lib/puppet/log.rb b/lib/puppet/log.rb index 6120df0ac..9fff07225 100644 --- a/lib/puppet/log.rb +++ b/lib/puppet/log.rb @@ -183,7 +183,7 @@ module Puppet # :nodoc: ] + RESET else puts @colors[msg.level] + "%s: %s: %s" % [ - msg.source, msg.level, msg.to_s + msg.level, msg.source, msg.to_s ] + RESET end when Puppet::Client::LogClient @@ -294,9 +294,13 @@ module Puppet # :nodoc: Log.newmessage(self) end + # If they pass a source in to us, we make sure it is a string, and + # we retrieve any tags we can. def source=(source) - # We can't store the actual source, we just store the path - if source.respond_to?(:path) + # We can't store the actual source, we just store the path. This + # is a bit of a stupid hack, specifically testing for elements, but + # eh. + if source.is_a?(Puppet::Element) and source.respond_to?(:path) @source = source.path else @source = source.to_s -- cgit