-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Adopt new logging patterns from tflog
#24165
Comments
We should consider adding an |
To be useful this will require using |
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! |
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. |
Community Note
Description
The
tflog
package provides functions for structured logging in lieu of usinglog.Printf("[LOG_LEVEL] some extended string")
. This not only allows for more consistent writing of logging, but also allows us to designate a distinct subsystem of code that outputs logs at a separately set verbosity level.For example:
terraform-plugin-sdk/v2
by default usestflog
to set upTF_LOG_SDK
andTF_LOG_PROVIDER
when initializingtfserver
; as such, these environmental variables are already supported by the provider. Similarly: we may be able to usetfsdklog
to specify separate verbosity levels for provider, testing, and sweeper logs.This is a sweeping change -- as it would alter every line of logging output across all files, but most of these can probably be replaced via a single complex
sed
command.References
Relates: #22922
The text was updated successfully, but these errors were encountered: