logging
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package logging contains framework internal helpers for consistent loggerand log entry handling.
Index¶
- Constants
- func FrameworkDebug(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkError(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkTrace(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkWarn(ctx context.Context, msg string, additionalFields ...map[string]interface{})
- func FrameworkWithAttributePath(ctx context.Context, attributePath string) context.Context
- func InitContext(ctx context.Context) context.Context
Constants¶
const (// Attribute path representation, which is typically in flatmap form such// as parent.0.child in this project.KeyAttributePath = "tf_attribute_path"// The type of action being operated on, such as "examplecloud_do_thing"KeyActionType = "tf_action_type"// The type of data source being operated on, such as "archive_file"KeyDataSourceType = "tf_data_source_type"// The type of ephemeral resource being operated on, such as "random_password"KeyEphemeralResourceType = "tf_ephemeral_resource_type"// The Deferred reason for an RPC responseKeyDeferredReason = "tf_deferred_reason"// Human readable string when calling a provider defined type that must// implement the Description() method, such as validators.KeyDescription = "description"// Underlying Go error string when logging an error.KeyError = "error"// The name of function being operated on, such as "parse_xyz"KeyFunctionName = "tf_function_name"// The type of resource being operated on, such as "random_pet"KeyResourceType = "tf_resource_type"// The type of list resource being operated on, such as "random_pet"KeyListResourceType = "tf_list_resource_type"// The type of value being operated on, such as "JSONStringValue".KeyValueType = "tf_value_type")
Structured logging keys.
Practitioners or tooling reading logs may be depending on these keys, so beconscious of that when changing them.
Refer to the terraform-plugin-go logging keys as well, which should beequivalent to these when possible.
const (// EnvTfLogSdkFramework is an environment variable that sets the logging// level of SDK framework loggers. Infers root SDK logging level, if// unset.EnvTfLogSdkFramework = "TF_LOG_SDK_FRAMEWORK")
Environment variables.
const (// SubsystemFramework is the tfsdklog subsystem name for framework.SubsystemFramework = "framework")Variables¶
This section is empty.
Functions¶
funcFrameworkDebug¶
FrameworkDebug emits a framework subsystem log at DEBUG level.
funcFrameworkError¶
FrameworkError emits a framework subsystem log at ERROR level.
funcFrameworkTrace¶
FrameworkTrace emits a framework subsystem log at TRACE level.
funcFrameworkWarn¶
FrameworkWarn emits a framework subsystem log at WARN level.
funcFrameworkWithAttributePath¶
FrameworkWithAttributePath returns a new Context with KeyAttributePath set.The attribute path is expected to be string, so the logging package does notneed to import path handling code.
Types¶
This section is empty.