Chris Roberts 0401f9cad4
Check super method to be called and force no arguments if none expected
This fixes an issue with Ruby 2.6 where `super` usage when no
    arguments are passed results in an argument error
2022-04-25 12:24:42 -05:00

24 lines
499 B
Ruby

module VagrantPlugins
module CommandServe
module Util
# Creates a new logger instance and provides method
# to access it
module HasLogger
def logger
@logger
end
def initialize(*args, **opts, &block)
@logger = Log4r::Logger.new(self.class.name.downcase)
if self.method(:initialize).super_method.parameters.empty?
super()
else
super
end
end
end
end
end
end