Skip to content

Commit cb093d8

Browse files
committed
Use proper logging
1 parent 74f811d commit cb093d8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/metasploit/framework/data_service/proxy/loot_data_proxy.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def report_loot(opts)
88
end
99
data_service.report_loot(opts)
1010
rescue Exception => e
11-
puts "Call to #{data_service.class}#report_loot threw exception: #{e.message}"
11+
elog "Call to #{data_service.class}#report_loot threw exception: #{e.message}"
1212
end
1313
end
1414

@@ -24,8 +24,8 @@ def loots(wspace, opts = {})
2424
opts[:wspace] = wspace
2525
data_service.loot(opts)
2626
rescue Exception => e
27-
puts "Call to #{data_service.class}#loots threw exception: #{e.message}"
28-
e.backtrace.each { |line| puts "#{line}\n" }
27+
elog "Call to #{data_service.class}#loots threw exception: #{e.message}"
28+
e.backtrace.each { |line| elog "#{line}\n" }
2929
end
3030
end
3131
alias_method :loot, :loots
@@ -35,8 +35,8 @@ def update_loot(opts)
3535
data_service = self.get_data_service
3636
data_service.update_loot(opts)
3737
rescue Exception => e
38-
puts "Call to #{data_service.class}#update_loot threw exception: #{e.message}"
39-
e.backtrace.each { |line| puts "#{line}\n" }
38+
elog "Call to #{data_service.class}#update_loot threw exception: #{e.message}"
39+
e.backtrace.each { |line| elog "#{line}\n" }
4040
end
4141
end
4242
end

lib/metasploit/framework/data_service/remote/http/response_data_helper.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def json_to_open_struct_object(response_wrapper, returns_on_error = nil)
1717
return JSON.parse(body, object_class: OpenStruct)
1818
end
1919
rescue Exception => e
20-
puts "open struct conversion failed #{e.message}"
20+
elog "open struct conversion failed #{e.message}"
2121
end
2222
end
2323

@@ -44,8 +44,8 @@ def json_to_mdm_object(response_wrapper, mdm_class, returns_on_error = nil)
4444
return rv
4545
end
4646
rescue Exception => e
47-
puts "Mdm Object conversion failed #{e.message}"
48-
e.backtrace.each { |line| puts "#{line}\n" }
47+
elog "Mdm Object conversion failed #{e.message}"
48+
e.backtrace.each { |line| elog "#{line}\n" }
4949
end
5050
end
5151

@@ -67,8 +67,8 @@ def process_file(base64_file, save_path)
6767
File.open(save_path, 'w+') { |file| file.write(decoded_file) }
6868
end
6969
rescue Exception => e
70-
puts "There was an error writing the file: #{e}"
71-
e.backtrace.each { |line| puts "#{line}\n"}
70+
elog "There was an error writing the file: #{e}"
71+
e.backtrace.each { |line| elog "#{line}\n"}
7272
end
7373
save_path
7474
end

0 commit comments

Comments
 (0)