Skip to content

Instantly share code, notes, and snippets.

@lak
Created March 15, 2010 18:22
Show Gist options
  • Select an option

  • Save lak/333133 to your computer and use it in GitHub Desktop.

Select an option

Save lak/333133 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'puppet'
require 'puppet/util/log'
require 'puppet/util/logging'
require 'puppet/transaction/report'
report = Puppet::Transaction::Report.new
Puppet::Util::Log.newdestination report
extend Puppet::Util::Logging
def to_s
# Some string describing the log source
"/Node[foo]/File[bar]"
end
info "This is a verbose message"
notice "This is a normal message"
err "This is a failure"
puts report.to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment