diff --git a/plugin/client.go b/plugin/client.go index 3a5cb7af0..7e2f4fecb 100644 --- a/plugin/client.go +++ b/plugin/client.go @@ -1,8 +1,10 @@ package plugin import ( + "os" "os/exec" + hclog "github.com/hashicorp/go-hclog" plugin "github.com/hashicorp/go-plugin" "github.com/hashicorp/terraform/plugin/discovery" ) @@ -10,11 +12,18 @@ import ( // ClientConfig returns a configuration object that can be used to instantiate // a client for the plugin described by the given metadata. func ClientConfig(m discovery.PluginMeta) *plugin.ClientConfig { + logger := hclog.New(&hclog.LoggerOptions{ + Name: "plugin", + Level: hclog.Trace, + Output: os.Stderr, + }) + return &plugin.ClientConfig{ Cmd: exec.Command(m.Path), HandshakeConfig: Handshake, Managed: true, Plugins: PluginMap, + Logger: logger, } }