Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.20.0 to 2.24.1. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.20.0...v2.24.1) --- updated-dependencies: - dependency-name: github.com/hashicorp/terraform-plugin-sdk/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package logging
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hashicorp/terraform-plugin-log/tfsdklog"
|
|
)
|
|
|
|
const (
|
|
// SubsystemProto is the tfsdklog subsystem name for protocol logging.
|
|
SubsystemProto = "proto"
|
|
)
|
|
|
|
// ProtocolError emits a protocol subsystem log at ERROR level.
|
|
func ProtocolError(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
|
|
tfsdklog.SubsystemError(ctx, SubsystemProto, msg, additionalFields...)
|
|
}
|
|
|
|
// ProtocolWarn emits a protocol subsystem log at WARN level.
|
|
func ProtocolWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
|
|
tfsdklog.SubsystemWarn(ctx, SubsystemProto, msg, additionalFields...)
|
|
}
|
|
|
|
// ProtocolTrace emits a protocol subsystem log at TRACE level.
|
|
func ProtocolTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{}) {
|
|
tfsdklog.SubsystemTrace(ctx, SubsystemProto, msg, additionalFields...)
|
|
}
|
|
|
|
// ProtocolSetField returns a context with the additional protocol subsystem
|
|
// field set.
|
|
func ProtocolSetField(ctx context.Context, key string, value any) context.Context {
|
|
return tfsdklog.SubsystemSetField(ctx, SubsystemProto, key, value)
|
|
}
|