Skip to content

Commit

Permalink
Replace use of tflog with log in provider-defined functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SarahFrench committed Mar 22, 2024
1 parent 7266f2d commit 4a7d700
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmv1/third_party/terraform/functions/element_from_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package functions
import (
"context"
"fmt"
"log"
"regexp"

"github.com/hashicorp/terraform-plugin-framework/function"
"github.com/hashicorp/terraform-plugin-log/tflog"
)

// ValidateElementFromIdArguments is reusable validation logic used in provider-defined functions that use the GetElementFromId function
Expand All @@ -20,7 +20,7 @@ func ValidateElementFromIdArguments(ctx context.Context, input string, regex *re

// >1 matches means input usable but not ideal; debug log
if len(submatches) > 1 {
tflog.Debug(ctx, fmt.Sprintf("Provider-defined function %s was called with input string: %s. This contains more than one match for the pattern %s. Terraform will use the first found match.", functionName, input, pattern))
log.Printf("[DEBUG] Provider-defined function %s was called with input string: %s. This contains more than one match for the pattern %s. Terraform will use the first found match.", functionName, input, pattern)
}

return nil
Expand Down

0 comments on commit 4a7d700

Please sign in to comment.