Include exception logger and attach to all available methods
This commit is contained in:
parent
914530d26a
commit
441f82760b
@ -11,7 +11,7 @@ module VagrantPlugins
|
||||
klass.prepend(Util::HasMapper)
|
||||
klass.prepend(Util::HasBroker)
|
||||
klass.prepend(Util::HasLogger)
|
||||
klass.prepend(Util::ExceptionLogger)
|
||||
klass.include(Util::ExceptionLogger)
|
||||
|
||||
klass.class_eval do
|
||||
attr_reader :capabilities, :default_args
|
||||
|
||||
@ -10,7 +10,7 @@ module VagrantPlugins
|
||||
prepend Util::HasMapper
|
||||
prepend Util::HasBroker
|
||||
prepend Util::HasLogger
|
||||
prepend Util::ExceptionLogger
|
||||
include Util::ExceptionLogger
|
||||
|
||||
def command_info_spec(*args)
|
||||
SDK::FuncSpec.new
|
||||
|
||||
@ -8,9 +8,9 @@ module VagrantPlugins
|
||||
|
||||
prepend Util::HasMapper
|
||||
prepend Util::HasBroker
|
||||
prepend Util::ExceptionLogger
|
||||
prepend Util::HasLogger
|
||||
include Util::HasSeeds::Service
|
||||
include Util::ExceptionLogger
|
||||
|
||||
def initialize(*args, **opts, &block)
|
||||
super()
|
||||
|
||||
@ -12,7 +12,7 @@ module VagrantPlugins
|
||||
class InternalService < Hashicorp::Vagrant::RubyVagrant::Service
|
||||
prepend Util::HasBroker
|
||||
prepend Util::HasLogger
|
||||
prepend Util::ExceptionLogger
|
||||
include Util::ExceptionLogger
|
||||
|
||||
def get_plugins(req, _unused_call)
|
||||
plugins = []
|
||||
|
||||
@ -12,7 +12,7 @@ module VagrantPlugins
|
||||
prepend Util::HasMapper
|
||||
prepend Util::HasBroker
|
||||
prepend Util::HasLogger
|
||||
prepend Util::ExceptionLogger
|
||||
include Util::ExceptionLogger
|
||||
|
||||
def usable(req, _unused_call)
|
||||
nil
|
||||
|
||||
@ -3,8 +3,8 @@ module VagrantPlugins
|
||||
module Util
|
||||
# Adds exception logging to all public instance methods
|
||||
module ExceptionLogger
|
||||
def self.prepended(klass)
|
||||
klass.public_instance_methods(false).each do |m_name|
|
||||
def self.included(klass)
|
||||
klass.public_instance_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