summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-07-24 00:27:44 -0700
committerLuke Kanies <luke@madstop.com>2009-08-01 12:50:42 -0700
commitac58e274c409b69073e304a8355bbe4ccb37350a (patch)
treeb256ad839bcc4c75a34af0260cb7ff5c18625748 /lib
parent6ed01037ad8b6d8d5ff7158ef6e09c785ed8b9fe (diff)
downloadpuppet-ac58e274c409b69073e304a8355bbe4ccb37350a.tar.gz
puppet-ac58e274c409b69073e304a8355bbe4ccb37350a.tar.xz
puppet-ac58e274c409b69073e304a8355bbe4ccb37350a.zip
Configuration version information is now in logs
The log instances have file, line, and config version information, although it's not currently printed. It's available in the reports, and you can strip it out with your own processors. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type.rb5
-rw-r--r--lib/puppet/util/log.rb7
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index 098d83254..33b4e92da 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -594,6 +594,11 @@ class Type
end
end
+ def version
+ return 0 unless catalog
+ catalog.version
+ end
+
# Meta-parameter methods: These methods deal with the results
# of specifying metaparameters
diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
index 94b0bcffa..6edc7f482 100644
--- a/lib/puppet/util/log.rb
+++ b/lib/puppet/util/log.rb
@@ -475,7 +475,7 @@ class Puppet::Util::Log
@levels.include?(level)
end
- attr_accessor :level, :message, :time, :remote
+ attr_accessor :level, :message, :time, :remote, :file, :line, :version
attr_reader :source
def initialize(args)
@@ -522,6 +522,11 @@ class Puppet::Util::Log
if source.respond_to?(:tags)
source.tags.each { |t| tag(t) }
end
+
+ [:file, :line, :version].each do |param|
+ next unless source.respond_to?(param)
+ send(param.to_s + "=", source.send(param))
+ end
end
def to_report