Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move debug logs to trace #710

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions internal/fwschemadata/data_set_at_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ func (d *Data) SetAtPath(ctx context.Context, path path.Path, val interface{}) d

if attrTypeWithValidate, ok := attrType.(xattr.TypeWithValidate); ok {
logging.FrameworkTrace(ctx, "Type implements TypeWithValidate")
logging.FrameworkDebug(ctx, "Calling provider defined Type Validate")
logging.FrameworkTrace(ctx, "Calling provider defined Type Validate")
diags.Append(attrTypeWithValidate.Validate(ctx, tfVal, path)...)
logging.FrameworkDebug(ctx, "Called provider defined Type Validate")
logging.FrameworkTrace(ctx, "Called provider defined Type Validate")

if diags.HasError() {
return diags
Expand Down Expand Up @@ -186,9 +186,9 @@ func (d Data) SetAtPathTransformFunc(ctx context.Context, path path.Path, tfVal

if attrTypeWithValidate, ok := parentAttrType.(xattr.TypeWithValidate); ok {
logging.FrameworkTrace(ctx, "Type implements TypeWithValidate")
logging.FrameworkDebug(ctx, "Calling provider defined Type Validate")
logging.FrameworkTrace(ctx, "Calling provider defined Type Validate")
diags.Append(attrTypeWithValidate.Validate(ctx, parentValue, parentPath)...)
logging.FrameworkDebug(ctx, "Called provider defined Type Validate")
logging.FrameworkTrace(ctx, "Called provider defined Type Validate")

if diags.HasError() {
return nil, diags
Expand Down
4 changes: 2 additions & 2 deletions internal/fwschemadata/data_value.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func (d Data) ValueAtPath(ctx context.Context, schemaPath path.Path) (attr.Value

if attrTypeWithValidate, ok := attrType.(xattr.TypeWithValidate); ok {
logging.FrameworkTrace(ctx, "Type implements TypeWithValidate")
logging.FrameworkDebug(ctx, "Calling provider defined Type Validate")
logging.FrameworkTrace(ctx, "Calling provider defined Type Validate")
diags.Append(attrTypeWithValidate.Validate(ctx, tfValue, schemaPath)...)
logging.FrameworkDebug(ctx, "Called provider defined Type Validate")
logging.FrameworkTrace(ctx, "Called provider defined Type Validate")

if diags.HasError() {
return nil, diags
Expand Down
40 changes: 20 additions & 20 deletions internal/fwserver/attribute_plan_modification.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func AttributePlanModifyBool(ctx context.Context, attribute fwxschema.AttributeW
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Bool",
map[string]interface{}{
Expand All @@ -559,7 +559,7 @@ func AttributePlanModifyBool(ctx context.Context, attribute fwxschema.AttributeW

planModifier.PlanModifyBool(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Bool",
map[string]interface{}{
Expand Down Expand Up @@ -684,7 +684,7 @@ func AttributePlanModifyFloat64(ctx context.Context, attribute fwxschema.Attribu
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Float64",
map[string]interface{}{
Expand All @@ -694,7 +694,7 @@ func AttributePlanModifyFloat64(ctx context.Context, attribute fwxschema.Attribu

planModifier.PlanModifyFloat64(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Float64",
map[string]interface{}{
Expand Down Expand Up @@ -819,7 +819,7 @@ func AttributePlanModifyInt64(ctx context.Context, attribute fwxschema.Attribute
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Int64",
map[string]interface{}{
Expand All @@ -829,7 +829,7 @@ func AttributePlanModifyInt64(ctx context.Context, attribute fwxschema.Attribute

planModifier.PlanModifyInt64(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Int64",
map[string]interface{}{
Expand Down Expand Up @@ -954,7 +954,7 @@ func AttributePlanModifyList(ctx context.Context, attribute fwxschema.AttributeW
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.List",
map[string]interface{}{
Expand All @@ -964,7 +964,7 @@ func AttributePlanModifyList(ctx context.Context, attribute fwxschema.AttributeW

planModifier.PlanModifyList(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.List",
map[string]interface{}{
Expand Down Expand Up @@ -1089,7 +1089,7 @@ func AttributePlanModifyMap(ctx context.Context, attribute fwxschema.AttributeWi
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Map",
map[string]interface{}{
Expand All @@ -1099,7 +1099,7 @@ func AttributePlanModifyMap(ctx context.Context, attribute fwxschema.AttributeWi

planModifier.PlanModifyMap(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Map",
map[string]interface{}{
Expand Down Expand Up @@ -1224,7 +1224,7 @@ func AttributePlanModifyNumber(ctx context.Context, attribute fwxschema.Attribut
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Number",
map[string]interface{}{
Expand All @@ -1234,7 +1234,7 @@ func AttributePlanModifyNumber(ctx context.Context, attribute fwxschema.Attribut

planModifier.PlanModifyNumber(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Number",
map[string]interface{}{
Expand Down Expand Up @@ -1359,7 +1359,7 @@ func AttributePlanModifyObject(ctx context.Context, attribute fwxschema.Attribut
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Object",
map[string]interface{}{
Expand All @@ -1369,7 +1369,7 @@ func AttributePlanModifyObject(ctx context.Context, attribute fwxschema.Attribut

planModifier.PlanModifyObject(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Object",
map[string]interface{}{
Expand Down Expand Up @@ -1494,7 +1494,7 @@ func AttributePlanModifySet(ctx context.Context, attribute fwxschema.AttributeWi
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Set",
map[string]interface{}{
Expand All @@ -1504,7 +1504,7 @@ func AttributePlanModifySet(ctx context.Context, attribute fwxschema.AttributeWi

planModifier.PlanModifySet(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Set",
map[string]interface{}{
Expand Down Expand Up @@ -1629,7 +1629,7 @@ func AttributePlanModifyString(ctx context.Context, attribute fwxschema.Attribut
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.String",
map[string]interface{}{
Expand All @@ -1639,7 +1639,7 @@ func AttributePlanModifyString(ctx context.Context, attribute fwxschema.Attribut

planModifier.PlanModifyString(ctx, planModifyReq, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.String",
map[string]interface{}{
Expand Down Expand Up @@ -1673,7 +1673,7 @@ func NestedAttributeObjectPlanModify(ctx context.Context, o fwschema.NestedAttri
Private: resp.Private,
}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined planmodifier.Object",
map[string]interface{}{
Expand All @@ -1683,7 +1683,7 @@ func NestedAttributeObjectPlanModify(ctx context.Context, o fwschema.NestedAttri

objectValidator.PlanModifyObject(ctx, req, planModifyResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined planmodifier.Object",
map[string]interface{}{
Expand Down
40 changes: 20 additions & 20 deletions internal/fwserver/attribute_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func AttributeValidateBool(ctx context.Context, attribute fwxschema.AttributeWit
// from modifying or removing diagnostics.
validateResp := &validator.BoolResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Bool",
map[string]interface{}{
Expand All @@ -191,7 +191,7 @@ func AttributeValidateBool(ctx context.Context, attribute fwxschema.AttributeWit

attributeValidator.ValidateBool(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Bool",
map[string]interface{}{
Expand Down Expand Up @@ -246,7 +246,7 @@ func AttributeValidateFloat64(ctx context.Context, attribute fwxschema.Attribute
// from modifying or removing diagnostics.
validateResp := &validator.Float64Response{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Float64",
map[string]interface{}{
Expand All @@ -256,7 +256,7 @@ func AttributeValidateFloat64(ctx context.Context, attribute fwxschema.Attribute

attributeValidator.ValidateFloat64(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Float64",
map[string]interface{}{
Expand Down Expand Up @@ -311,7 +311,7 @@ func AttributeValidateInt64(ctx context.Context, attribute fwxschema.AttributeWi
// from modifying or removing diagnostics.
validateResp := &validator.Int64Response{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Int64",
map[string]interface{}{
Expand All @@ -321,7 +321,7 @@ func AttributeValidateInt64(ctx context.Context, attribute fwxschema.AttributeWi

attributeValidator.ValidateInt64(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Int64",
map[string]interface{}{
Expand Down Expand Up @@ -376,7 +376,7 @@ func AttributeValidateList(ctx context.Context, attribute fwxschema.AttributeWit
// from modifying or removing diagnostics.
validateResp := &validator.ListResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.List",
map[string]interface{}{
Expand All @@ -386,7 +386,7 @@ func AttributeValidateList(ctx context.Context, attribute fwxschema.AttributeWit

attributeValidator.ValidateList(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.List",
map[string]interface{}{
Expand Down Expand Up @@ -441,7 +441,7 @@ func AttributeValidateMap(ctx context.Context, attribute fwxschema.AttributeWith
// from modifying or removing diagnostics.
validateResp := &validator.MapResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Map",
map[string]interface{}{
Expand All @@ -451,7 +451,7 @@ func AttributeValidateMap(ctx context.Context, attribute fwxschema.AttributeWith

attributeValidator.ValidateMap(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Map",
map[string]interface{}{
Expand Down Expand Up @@ -506,7 +506,7 @@ func AttributeValidateNumber(ctx context.Context, attribute fwxschema.AttributeW
// from modifying or removing diagnostics.
validateResp := &validator.NumberResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Number",
map[string]interface{}{
Expand All @@ -516,7 +516,7 @@ func AttributeValidateNumber(ctx context.Context, attribute fwxschema.AttributeW

attributeValidator.ValidateNumber(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Number",
map[string]interface{}{
Expand Down Expand Up @@ -571,7 +571,7 @@ func AttributeValidateObject(ctx context.Context, attribute fwxschema.AttributeW
// from modifying or removing diagnostics.
validateResp := &validator.ObjectResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Object",
map[string]interface{}{
Expand All @@ -581,7 +581,7 @@ func AttributeValidateObject(ctx context.Context, attribute fwxschema.AttributeW

attributeValidator.ValidateObject(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Object",
map[string]interface{}{
Expand Down Expand Up @@ -636,7 +636,7 @@ func AttributeValidateSet(ctx context.Context, attribute fwxschema.AttributeWith
// from modifying or removing diagnostics.
validateResp := &validator.SetResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Set",
map[string]interface{}{
Expand All @@ -646,7 +646,7 @@ func AttributeValidateSet(ctx context.Context, attribute fwxschema.AttributeWith

attributeValidator.ValidateSet(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Set",
map[string]interface{}{
Expand Down Expand Up @@ -701,7 +701,7 @@ func AttributeValidateString(ctx context.Context, attribute fwxschema.AttributeW
// from modifying or removing diagnostics.
validateResp := &validator.StringResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.String",
map[string]interface{}{
Expand All @@ -711,7 +711,7 @@ func AttributeValidateString(ctx context.Context, attribute fwxschema.AttributeW

attributeValidator.ValidateString(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.String",
map[string]interface{}{
Expand Down Expand Up @@ -930,7 +930,7 @@ func NestedAttributeObjectValidate(ctx context.Context, o fwschema.NestedAttribu
// from modifying or removing diagnostics.
validateResp := &validator.ObjectResponse{}

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Calling provider defined validator.Object",
map[string]interface{}{
Expand All @@ -940,7 +940,7 @@ func NestedAttributeObjectValidate(ctx context.Context, o fwschema.NestedAttribu

objectValidator.ValidateObject(ctx, validateReq, validateResp)

logging.FrameworkDebug(
logging.FrameworkTrace(
ctx,
"Called provider defined validator.Object",
map[string]interface{}{
Expand Down
Loading