76: def setup
77: exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
78:
79: raise "Inspect requires reporting to be enabled. Set report=true in puppet.conf to enable reporting." unless Puppet[:report]
80:
81: @report = Puppet::Transaction::Report.new("inspect")
82:
83: Puppet::Util::Log.newdestination(@report)
84: Puppet::Util::Log.newdestination(:console) unless options[:logset]
85:
86: trap(:INT) do
87: $stderr.puts "Exiting"
88: exit(1)
89: end
90:
91: if options[:debug]
92: Puppet::Util::Log.level = :debug
93: elsif options[:verbose]
94: Puppet::Util::Log.level = :info
95: end
96:
97: Puppet::Transaction::Report.terminus_class = :rest
98: Puppet::Resource::Catalog.terminus_class = :yaml
99: end