Set dynamic logger when creating factory function

This commit is contained in:
Chris Roberts 2021-07-13 16:46:36 -07:00 committed by Paul Hinze
parent 434cc89a95
commit 886a2b1f69
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -10,6 +10,7 @@ import (
"reflect"
"github.com/hashicorp/go-argmapper"
"github.com/hashicorp/vagrant-plugin-sdk/internal-shared/dynamic"
)
// Factory keeps track of named dependency-injected factory functions to
@ -48,7 +49,8 @@ func New(iface interface{}) (*Factory, error) {
// fn may take any number and types of inputs. It is the callers responsibilty
// when using Func and Call to pass in the required parameters.
func (f *Factory) Register(name string, fn interface{}) error {
ff, err := argmapper.NewFunc(fn)
ff, err := argmapper.NewFunc(fn,
argmapper.Logger(dynamic.Logger))
if err != nil {
return err
}