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

internal/proto6server: Ensure logging.InitContext is called before any RPC logic #314

Merged
merged 2 commits into from May 4, 2022

Commits on May 4, 2022

  1. internal/proto6server: Ensure logging.InitContext is called before an…

    …y RPC logic
    
    Verified with terraform-provider-corner. Creating unit testing for this setup requires something like hashicorp/terraform-plugin-log#61 upstream.
    
    Previously:
    
    ```text
    2022-05-03T13:38:24.417-0400 [DEBUG] sdk.framework: Calling provider defined Provider GetResources: new_logger_warning="This log was generated by an SDK subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=44608b15-0686-e9f9-1d17-56ca3c63b336 tf_resource_type=framework_user tf_rpc=ApplyResourceChange
    2022-05-03T13:38:24.417-0400 [DEBUG] sdk.framework: Called provider defined Provider GetResources: new_logger_warning="This log was generated by an SDK subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=44608b15-0686-e9f9-1d17-56ca3c63b336 tf_resource_type=framework_user tf_rpc=ApplyResourceChange
    2022-05-03T13:38:24.417-0400 [DEBUG] sdk.framework: Calling provider defined ResourceType GetSchema: new_logger_warning="This log was generated by an SDK subsystem logger that wasn't created before being used. Use tflog.NewSubsystem to create this logger before it is used." tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=44608b15-0686-e9f9-1d17-56ca3c63b336 tf_resource_type=framework_user tf_rpc=ApplyResourceChange
    ```
    
    Now:
    
    ```text
    2022-05-04T09:21:20.515-0400 [DEBUG] sdk.framework: Calling provider defined Provider GetResources
    2022-05-04T09:21:20.515-0400 [DEBUG] sdk.framework: Called provider defined Provider GetResources
    2022-05-04T09:21:20.515-0400 [DEBUG] sdk.framework: Calling provider defined ResourceType GetSchema
    2022-05-04T09:21:20.515-0400 [DEBUG] sdk.framework: Called provider defined ResourceType GetSchema
    ```
    bflad committed May 4, 2022
    Copy the full SHA
    387cc0a View commit details
    Browse the repository at this point in the history
  2. Update CHANGELOG for #314

    bflad committed May 4, 2022
    Copy the full SHA
    0af5720 View commit details
    Browse the repository at this point in the history