You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when creating tflog or tfsdklog subsystems, the new subsystem has none of the parent With() keys. While this is generally desirable, there are cases where a subsystem should also include the parent keys for context, e.g. the framework subsystem. Otherwise, you lose context such as:
2022-05-03T16:40:48.546-0400 [TRACE] sdk.proto: Received request: tf_proto_version=6.0 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=844ea3c5-a119-9176-f8cb-33ddfc823135 tf_resource_type=framework_user tf_rpc=ApplyResourceChange
2022-05-03T16:40:48.546-0400 [TRACE] sdk.proto: Calling downstream: tf_proto_version=6.0 tf_provider_addr=registry.terraform.io/hashicorp/framework tf_req_id=844ea3c5-a119-9176-f8cb-33ddfc823135 tf_resource_type=framework_user tf_rpc=ApplyResourceChange
2022-05-03T16:40:48.546-0400 [DEBUG] sdk.framework: Calling provider defined Provider GetResources
2022-05-03T16:40:48.546-0400 [DEBUG] sdk.framework: Called provider defined Provider GetResources
Proposal
Add IncludeRootFields bool to logging.Option
Create WithRootFields() logging.Option in tflog and tfsdklog
If opts.IncludeRootFields is detected in NewSubsystem(), grab root fields via (Logger).ImpliedArgs() and call With on the new subsystem logger.
The text was updated successfully, but these errors were encountered:
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
terraform-plugin-log version
Use cases
Currently when creating
tflog
ortfsdklog
subsystems, the new subsystem has none of the parentWith()
keys. While this is generally desirable, there are cases where a subsystem should also include the parent keys for context, e.g. the framework subsystem. Otherwise, you lose context such as:Proposal
IncludeRootFields bool
tologging.Option
WithRootFields() logging.Option
intflog
andtfsdklog
opts.IncludeRootFields
is detected inNewSubsystem()
, grab root fields via(Logger).ImpliedArgs()
and callWith
on the new subsystem logger.The text was updated successfully, but these errors were encountered: