summaryrefslogtreecommitdiffstats
path: root/lib/puppet/log.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-11-01 00:06:14 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-11-01 00:06:14 +0000
commit14d8186ebe8740eab1b320e6a1d6c98c255ad70f (patch)
treeb98daca4feaf4165e518f62a12bc39a9aec872e6 /lib/puppet/log.rb
parent03357432210eecc5f370f812f473bc5d0a062d64 (diff)
downloadpuppet-14d8186ebe8740eab1b320e6a1d6c98c255ad70f.tar.gz
puppet-14d8186ebe8740eab1b320e6a1d6c98c255ad70f.tar.xz
puppet-14d8186ebe8740eab1b320e6a1d6c98c255ad70f.zip
Making paths work a little more intelligently
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@739 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/log.rb')
-rw-r--r--lib/puppet/log.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/puppet/log.rb b/lib/puppet/log.rb
index 7c30e88b5..c470dd5df 100644
--- a/lib/puppet/log.rb
+++ b/lib/puppet/log.rb
@@ -188,6 +188,22 @@ module Puppet # :nodoc:
end
when Puppet::Client::LogClient
unless msg.is_a?(String) or msg.remote
+ unless defined? @hostname
+ @hostname = Facter["hostname"].value
+ end
+ unless defined? @domain
+ @domain = Facter["domain"].value
+ if @domain
+ @hostname += "." + @domain
+ end
+ end
+ if msg.source =~ /^\//
+ msg.source = @hostname + ":" + msg.source
+ elsif msg.source == "Puppet"
+ msg.source = @hostname + " " + msg.source
+ else
+ msg.source = @hostname + " " + msg.source
+ end
begin
#puts "would have sent %s" % msg
#puts "would have sent %s" %
@@ -198,6 +214,7 @@ module Puppet # :nodoc:
puts "Could not dump: %s" % detail.to_s
return
end
+ # Add the hostname to the source
dest.addlog(tmp)
#dest.addlog(msg.to_s)
sleep(0.5)