NOTES:
- This Go module has been updated to Go 1.24 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#263)
- tfsdklog.RegisterTestSink is deprecated in favor or tfsdklog.ContextWithTestLogging (#264)
FEATURES:
- Added
tfsdklog.ContextWithStandardLogging()for test sweeper logging (#162)
NOTES:
- This Go module has been updated to Go 1.19 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#137)
ENHANCEMENTS:
- tfsdklog: Improved logging performance 20x when logs would be skipped due to logging level (#149)
NOTES:
- This Go module has been updated to Go 1.18 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#95)
BUG FIXES:
- tflog+tflogsdk: Prevented data race conditions when using SetField and other option functions (#132)
FEATURES:
- tflog: Added
MaskAllFieldValuesRegexes(),MaskAllFieldValuesStrings(),MaskLogRegexes()andMaskLogStrings()functions, which extend further the log masking filtering, for the provider root logger (#87) - tflog: Added
SubsystemMaskAllFieldValuesRegexes(),SubsystemMaskAllFieldValuesStrings(),SubsystemMaskLogRegexes()andSubsystemMaskLogStrings()functions, which extend further the log masking filtering, for provider subsystem loggers (#87) - tfsdklog: Same functions added to the
tflogpackage (#87)
BREAKING CHANGES:
- tflog: renamed
With()andSubsystemWith(), toSetField()andSubsystemSetField()respectively (#78) - tflog: renamed
WithMaskFieldValueWithFieldKeys()andSubsystemWithMaskFieldValueWithFieldKeys(), toMaskFieldValuesWithFieldKeys()andSubsystemMaskFieldValuesWithFieldKeys()respectively (#78) - tflog: renamed
WithMaskLogMatchingString()andSubsystemWithMaskLogMatchingString(), toMaskMessageStrings()andSubsystemMaskMessageStrings()respectively (#78) - tflog: renamed
WithMaskMessageRegex()andSubsystemWithMaskMessageRegex(), toMaskMessageRegexes()andSubsystemMaskMessageRegexes()respectively (#78) - tflog: renamed
WithOmitLogMatchingString()andSubsystemWithOmitLogMatchingString(), toOmitLogWithMessageStrings()andSubsystemOmitLogWithMessageStrings()respectively (#78) - tflog: renamed
WithOmitLogWithFieldKeys()andSubsystemWithOmitLogWithFieldKeys(), toOmitLogWithFieldKeys()andSubsystemOmitLogWithFieldKeys()respectively (#78) - tflog: renamed
WithOmitLogWithMessageRegex()andSubsystemWithOmitLogWithMessageRegex(), toOmitLogWithMessageRegexes()andSubsystemOmitLogWithMessageRegexes()respectively (#78) - tfsdklog: same renaming as for the
tflogpackage (#78)
FEATURES:
- tflog: Added
SubsystemWithOmitLogWithFieldKeys(),SubsystemWithOmitLogWithMessageRegex(),SubsystemWithOmitLogMatchingString(),SubsystemWithMaskFieldValueWithFieldKeys(),SubsystemWithMaskMessageRegex()andSubsystemWithMaskLogMatchingString()functions, which provide log omission and log masking filtering, based on message and argument keys, for provider subsystem loggers (#71) - tflog: Added
WithOmitLogWithFieldKeys(),WithOmitLogWithMessageRegex(),WithOmitLogMatchingString(),WithMaskFieldValueWithFieldKeys(),WithMaskMessageRegex()andWithMaskLogMatchingString()functions, which provide log omission and log masking filtering, based on message and argument keys, for the provider root logger (#71) - tfsdklog: Added
SubsystemWithOmitLogWithFieldKeys(),SubsystemWithOmitLogWithMessageRegex(),SubsystemWithOmitLogMatchingString(),SubsystemWithMaskFieldValueWithFieldKeys(),SubsystemWithMaskMessageRegex()andSubsystemWithMaskLogMatchingString()functions, which provide log omission and log masking filtering, based on message and argument keys, for SDK subsystem loggers (#71) - tfsdklog: Added
WithOmitLogWithFieldKeys(),WithOmitLogWithMessageRegex(),WithOmitLogMatchingString(),WithMaskFieldValueWithFieldKeys(),WithMaskMessageRegex()andWithMaskLogMatchingString()functions, which provide log omission and log masking filtering, based on message and argument keys, for the SDK root logger (#71)
NOTES:
- The
gopkg.in/yaml.v3dependency has been updated to address CVE-2022-28948 (#69)
NOTES:
- This Go module has been updated to Go 1.17 per the Go support policy. Any consumers building on earlier Go versions may experience errors. (#51)
FEATURES:
- Added
tflogtestpackage, which provides functionality for unit testing of provider logging (#62) - Added
tfsdklogtestpackage, which provides functionality for unit testing of SDK logging (#62)
ENHANCEMENTS:
- tflog: Added
WithRootFields()function, which can copy root logger fields to a new subsystem logger duringNewSubsystem()(#60) - tfsdklog: Added
WithRootFields()function, which can copy root logger fields to a new subsystem logger duringNewSubsystem()(#60)
BUG FIXES:
- tflog+tfsdklog: Prevented
Unable to create logging subsystem with AdditionalLocationOffset due to missing root logger optionswarning logs during acceptance testing (#58)
NOTES:
- The following Go modules, if used, must be also be updated when updating to this terraform-plugin-log version:
- terraform-plugin-framework: v0.6.0 or higher
- terraform-plugin-go: v0.8.0 or higher
- terraform-plugin-mux: v0.6.0 or higher
- terraform-plugin-sdk: v2.11.0 or higher
BREAKING CHANGES:
- tflog: The
Trace(),Debug(),Info(),Warn(), andError()functions andSubsystemequivalents now use...map[string]interface{}as the final optional parameter, where thestringis the structured logging key, rather than expecting matchedkey interface{}, value interface{}pairs. If multiple maps contain the same key, the value is shallow merged. (#34) - tfsdklog: The
Trace(),Debug(),Info(),Warn(), andError()functions andSubsystemequivalents now use...map[string]interface{}as the final optional parameter, where thestringis the structured logging key, rather than expecting matchedkey interface{}, value interface{}pairs. If multiple maps contain the same key, the value is shallow merged. (#34)
ENHANCEMENTS:
- tflog: Added
WithAdditionalLocationOffsetfunction, which allows implementations to adjust the location offset when using helper functions (#36) - tfsdklog: Added
WithAdditionalLocationOffsetfunction, which allows implementations to adjust the location offset when using helper functions (#36)
BUG FIXES:
- tfsdklog: Consolidated multiple invalid log level messages and added missing newline (#35)
BUG FIXES:
- Fixed a panic when logging to a subsystem when logging has not been set up on the context. Should only impact unit tests and other situations where an SDK isn't instantiating the logging context. (#24)
BREAKING CHANGES:
- Provider log outputs now default to being named "provider" unless another name is provided. (#9)
- The
tflogpackage has been moved togithub.com/hashicorp/terraform-plugin-log/tflogto make it work better with goimports and other tooling. (#7) - The
tfsdklogpackage has been moved togithub.com/hashicorp/terraform-plugin-log/tfsdklogto make it work better with goimports and other tooling. (#7) - With the release of Go 1.17, Go 1.16 is now the lowest supported version of Go to use with terraform-plugin-log. (#8)
tflog.Newhas been moved totfsdklog.NewRootProviderLogger. Provider developers should not need this functionality. (#10)tflog.Optionhas been moved to an internal package. Consumers can no longer reference the type. (#10)tflog.WithLogNamehas been removed. SDK developers should usetfsdklog.WithLogName. Provider developers should not need this functionality. (#10)tflog.WithStderrFromInithas been removed. SDK developers should usetfsdklog.WithStderrFromInit. Provider developers should not need this functionality. (#10)tfsdklog.Newhas been renamedtfsdklog.NewRootLogger. (#10)tfsdklog.Optionhas been moved to an internal package. Consumers can no longer reference the type. (#10)
FEATURES:
- Added a
tfsdklog.RegisterTestSinkfunction that will turn on a logging sink appropriate for use in testing. When a logging sink is activated, all downstream provider and SDK loggers (i.e., all loggers created aftertfsdklog.RegisterTestSinkis called) will be sub-loggers of the sink. The sink respects theTF_LOG,TF_LOG_PATH,TF_ACC_LOG_PATH, andTF_LOG_PATH_MASKenvironment variables, by default discards logs, and when onlyTF_LOGis set writes to stderr. It is meant to replicate Terraform's log aggregation and filtering capabilities for test frameworks. (#9)
FEATURES:
- Build out the beginnings of the module, allowing for providers, SDKs, and their subsystems to use an opinionated interface to log data about their execution. (#2)