Only add exception logger to non-generic methods
This commit is contained in:
parent
441f82760b
commit
0dcefddae4
@ -4,7 +4,13 @@ module VagrantPlugins
|
||||
# Adds exception logging to all public instance methods
|
||||
module ExceptionLogger
|
||||
def self.included(klass)
|
||||
klass.public_instance_methods.each do |m_name|
|
||||
# Get all the public instance methods. Need to search ancestors as well
|
||||
# for modules like the Guest service which includes the CapabilityPlatform
|
||||
# module
|
||||
klass_public_instance_methods = klass.public_instance_methods
|
||||
# Remove all generic instance methods from the list of ones to modify
|
||||
logged_methods = klass_public_instance_methods - Object.public_instance_methods
|
||||
logged_methods.each do |m_name|
|
||||
klass.define_method(m_name) do |*args, **opts, &block|
|
||||
begin
|
||||
super(*args, **opts, &block)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user