Use proper logging

GSoC/Meterpreter_Web_Console
James Barnett 2018-02-07 10:25:56 -06:00
parent 74f811d865
commit cb093d8063
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
2 changed files with 10 additions and 10 deletions

View File

@ -8,7 +8,7 @@ module LootDataProxy
end
data_service.report_loot(opts)
rescue Exception => e
puts "Call to #{data_service.class}#report_loot threw exception: #{e.message}"
elog "Call to #{data_service.class}#report_loot threw exception: #{e.message}"
end
end
@ -24,8 +24,8 @@ module LootDataProxy
opts[:wspace] = wspace
data_service.loot(opts)
rescue Exception => e
puts "Call to #{data_service.class}#loots threw exception: #{e.message}"
e.backtrace.each { |line| puts "#{line}\n" }
elog "Call to #{data_service.class}#loots threw exception: #{e.message}"
e.backtrace.each { |line| elog "#{line}\n" }
end
end
alias_method :loot, :loots
@ -35,8 +35,8 @@ module LootDataProxy
data_service = self.get_data_service
data_service.update_loot(opts)
rescue Exception => e
puts "Call to #{data_service.class}#update_loot threw exception: #{e.message}"
e.backtrace.each { |line| puts "#{line}\n" }
elog "Call to #{data_service.class}#update_loot threw exception: #{e.message}"
e.backtrace.each { |line| elog "#{line}\n" }
end
end
end

View File

@ -17,7 +17,7 @@ module ResponseDataHelper
return JSON.parse(body, object_class: OpenStruct)
end
rescue Exception => e
puts "open struct conversion failed #{e.message}"
elog "open struct conversion failed #{e.message}"
end
end
@ -44,8 +44,8 @@ module ResponseDataHelper
return rv
end
rescue Exception => e
puts "Mdm Object conversion failed #{e.message}"
e.backtrace.each { |line| puts "#{line}\n" }
elog "Mdm Object conversion failed #{e.message}"
e.backtrace.each { |line| elog "#{line}\n" }
end
end
@ -67,8 +67,8 @@ module ResponseDataHelper
File.open(save_path, 'w+') { |file| file.write(decoded_file) }
end
rescue Exception => e
puts "There was an error writing the file: #{e}"
e.backtrace.each { |line| puts "#{line}\n"}
elog "There was an error writing the file: #{e}"
e.backtrace.each { |line| elog "#{line}\n"}
end
save_path
end