diff --git a/ldap/provider.go b/ldap/provider.go index da673b0..41b74ea 100644 --- a/ldap/provider.go +++ b/ldap/provider.go @@ -2,6 +2,7 @@ package ldap import ( "github.com/Ouest-France/goldap" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -62,7 +63,6 @@ func Provider() *schema.Provider { } func providerConfigure(d *schema.ResourceData) (interface{}, error) { - client := &goldap.Client{ Host: d.Get("host").(string), Port: d.Get("port").(int), @@ -78,5 +78,9 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { return nil, err } + if logging.IsDebugOrHigher() { + client.Conn.Debug.Enable(true) + } + return client, nil }