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

tfsdklog: Ensure sink logger options are propagated to SDK and provider root loggers #58

Merged
merged 4 commits into from
May 4, 2022

Conversation

bflad
Copy link
Contributor

@bflad bflad commented May 3, 2022

Closes #54

Verified via terraform-provider-corner.

Previously:

$ TF_ACC=1 TF_LOG=WARN go test -count=1 -run='TestAccFrameworkResourceUser$' -v ./internal/frameworkprovider
=== RUN   TestAccFrameworkResourceUser
2022-05-03T14:42:25.505-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.666-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.668-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.668-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.670-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.671-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.671-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.672-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.672-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.245-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.247-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.248-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.249-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.249-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.249-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.252-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.253-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:52.798-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.552-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.554-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.555-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.555-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.556-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.557-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.558-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:00.146-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.701-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.703-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.703-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.704-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.705-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.705-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.706-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.707-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.707-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:09.252-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.803-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.805-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.806-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.807-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.808-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.808-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.809-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.810-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.811-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.811-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.382-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.385-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.385-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.387-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.387-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.387-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.388-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.389-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.390-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:22.938-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:25.649-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.199-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.200-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.200-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.203-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.203-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.205-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.206-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.206-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.206-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.207-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
--- PASS: TestAccFrameworkResourceUser (64.75s)
PASS
ok      github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       65.006s

Now:

$ TF_ACC=1 TF_LOG=WARN go test -count=1 -run='TestAccFrameworkResourceUser$' -v ./internal/frameworkprovider
=== RUN   TestAccFrameworkResourceUser
--- PASS: TestAccFrameworkResourceUser (64.76s)
PASS
ok      github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       68.569s

…er root loggers

Reference: #54

Verified via terraform-provider-corner.

Previously:

```console
$ TF_ACC=1 TF_LOG=WARN go test -count=1 -run='TestAccFrameworkResourceUser$' -v ./internal/frameworkprovider
=== RUN   TestAccFrameworkResourceUser
2022-05-03T14:42:25.505-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.666-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.668-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.668-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.670-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.671-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.671-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.672-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:43.672-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.245-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.247-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.248-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.249-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.249-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.249-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.252-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:48.253-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:52.798-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.552-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.554-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.555-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.555-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.556-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.557-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:42:55.558-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:00.146-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.701-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.703-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.703-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.704-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.705-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.705-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.706-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.707-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:04.707-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:09.252-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.803-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.805-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.806-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.807-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.808-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.808-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.809-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.810-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.811-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:13.811-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.382-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.385-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.385-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.387-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.387-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.387-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.388-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.389-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:18.390-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:22.938-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:25.649-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.199-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.200-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.200-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.203-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.203-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.205-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.206-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.206-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.206-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
2022-05-03T14:43:30.207-0400 [WARN]  sdk: Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger options
--- PASS: TestAccFrameworkResourceUser (64.75s)
PASS
ok      github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       65.006s
```

Now:

```console
$ TF_ACC=1 TF_LOG=WARN go test -count=1 -run='TestAccFrameworkResourceUser$' -v ./internal/frameworkprovider
=== RUN   TestAccFrameworkResourceUser
--- PASS: TestAccFrameworkResourceUser (64.76s)
PASS
ok      github.com/hashicorp/terraform-provider-corner/internal/frameworkprovider       68.569s
```
@bflad bflad added the bug Something isn't working label May 3, 2022
@bflad bflad added this to the v0.4.0 milestone May 3, 2022
@bflad bflad requested a review from a team as a code owner May 3, 2022 18:55
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bflad bflad merged commit 0a383c3 into main May 4, 2022
@bflad bflad deleted the bflad-fix-warnings branch May 4, 2022 13:13
@github-actions
Copy link

github-actions bot commented Jun 4, 2022

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Acceptance tests configure logger with missing root logger causing significant noise
2 participants