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

Docs: don't outright discard the legacy way of logging as sometimes, it's the only solution #144

Closed
3 of 6 tasks
mlcdf opened this issue Mar 28, 2023 · 3 comments · Fixed by #145
Closed
3 of 6 tasks
Labels
documentation Improvements or additions to documentation

Comments

@mlcdf
Copy link

mlcdf commented Mar 28, 2023

Does this documenation exist?

  • This is new documentation
  • This is an enhancement to existing documentation

Where would you expect to find this documentation?

  • On terraform.io
  • In the GoDoc for this module
  • In this repo as a markdown file
  • Somewhere else

Details

The following docs regarding logging are a bit misleading:

They either suggest that tflog is the only way to log or describe log.Prinftas the legacy way.

But if you want to log in a hook that does not pass a context.Context, the legacy way is the only way to do so.

Some hooks that don't pass a context:

  • StateFunc
  • ValidateDiagFunc
  • DiffSuppressFunc

Description

Different wording explaining that in some cases, using the legacy way of logging is OK and the only way to do so.

(I'm a terraform newbie so I apologize if I missed something)

@mlcdf mlcdf added the documentation Improvements or additions to documentation label Mar 28, 2023
@bendbennett
Copy link
Contributor

bendbennett commented Mar 29, 2023

Hi @mlcdf 👋

Thank you for raising this issue. As this issue relates specifically to functions that are available within terraform-plugin-sdk I am going to transfer the issue to that repository and we will review updating the documentation for the SDK.

@bendbennett bendbennett transferred this issue from hashicorp/terraform-plugin-log Mar 29, 2023
@bendbennett bendbennett transferred this issue from hashicorp/terraform-plugin-sdk Mar 29, 2023
bendbennett added a commit that referenced this issue Mar 29, 2023
bendbennett added a commit that referenced this issue Mar 29, 2023
bendbennett added a commit that referenced this issue Mar 30, 2023
bendbennett added a commit that referenced this issue Mar 30, 2023
… context (#145)

* Adding reference to functions in SDK that do not supply context and have to use legacy logging (#144)

* Rewording (#144)
@mlcdf
Copy link
Author

mlcdf commented Mar 30, 2023

Thanks :)

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 30, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
2 participants