summaryrefslogtreecommitdiffstats
path: root/lib/puppet/log.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-11-16 17:12:11 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-11-16 17:12:11 +0000
commita4562bfba94d18da54ad9560245d0669cc151c76 (patch)
treee923cb50e33737ba06ef6aefce373fbb9f3f97ff /lib/puppet/log.rb
parent42a9d9a3f8ac698370c36c4ca631e82797e01ece (diff)
downloadpuppet-a4562bfba94d18da54ad9560245d0669cc151c76.tar.gz
puppet-a4562bfba94d18da54ad9560245d0669cc151c76.tar.xz
puppet-a4562bfba94d18da54ad9560245d0669cc151c76.zip
Lots of refactoring, and added the capture_stderr method
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@742 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/log.rb')
-rw-r--r--lib/puppet/log.rb10
1 files changed, 7 insertions, 3 deletions
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